Compare commits
18 Commits
Author | SHA1 | Date |
---|---|---|
Jawira Portugal | 9417315afa | |
jawira | cc467e4a2d | |
Jawira Portugal | a690f8075b | |
jawira | 74cb3040b8 | |
Jawira Portugal | 7dddc44272 | |
jawira | 3de69f2bde | |
jawira | 715ec4619b | |
Jawira Portugal | aab04155e5 | |
jawira | 854eb13039 | |
jawira | a194d92474 | |
Jawira Portugal | 6c51671e00 | |
jawira | bff303bfa6 | |
jawira | b03d0252d3 | |
Jawira Portugal | 9599374b0c | |
jawira | 015484b727 | |
jawira | bab76f4256 | |
Jawira Portugal | ae2893551f | |
jawira | 34960927dd |
|
@ -5,16 +5,16 @@ charset = utf-8
|
|||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.php]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
|
||||
[*.{yml, yaml, neon, xml, xsl, json}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
[*.{md, markdown}]
|
||||
trim_trailing_whitespace = false
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
max_line_length = 80
|
||||
|
||||
[.gitattributes]
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
/.gitattributes export-ignore
|
||||
/.editorconfig export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.idea export-ignore
|
||||
/docs export-ignore
|
||||
/resources export-ignore
|
||||
/build.xml export-ignore
|
||||
/build.png export-ignore
|
||||
/CONTRIBUTING.md export-ignore
|
||||
/README.md export-ignore
|
||||
/CHANGELOG.md export-ignore
|
||||
/.idea export-ignore
|
||||
/docs export-ignore
|
||||
/tasks export-ignore
|
||||
/tests export-ignore
|
||||
/resources export-ignore
|
||||
/.editorconfig export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/build.svg export-ignore
|
||||
/build.png export-ignore
|
||||
/build.xml export-ignore
|
||||
/CHANGELOG.md export-ignore
|
||||
/README.md export-ignore
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="jawira">
|
||||
<words>
|
||||
<w>barthelemy</w>
|
||||
<w>barthélemy</w>
|
||||
<w>bento</w>
|
||||
<w>biohazard</w>
|
||||
<w>blowfish</w>
|
||||
<w>bouvet</w>
|
||||
<w>buildfile</w>
|
||||
<w>burkina</w>
|
||||
<w>cableway</w>
|
||||
<w>caicos</w>
|
||||
<w>ceuta</w>
|
||||
<w>clipperton</w>
|
||||
<w>cunha</w>
|
||||
<w>curaçao</w>
|
||||
<w>czechia</w>
|
||||
<w>côte</w>
|
||||
<w>dango</w>
|
||||
<w>dharma</w>
|
||||
<w>divoire</w>
|
||||
<w>diya</w>
|
||||
<w>emojis</w>
|
||||
<w>eswatini</w>
|
||||
<w>facepalming</w>
|
||||
<w>falafel</w>
|
||||
<w>faroe</w>
|
||||
<w>faso</w>
|
||||
<w>flatbread</w>
|
||||
<w>futuna</w>
|
||||
<w>gbeng</w>
|
||||
<w>gbsct</w>
|
||||
<w>gbwls</w>
|
||||
<w>gitattributes</w>
|
||||
<w>gitignore</w>
|
||||
<w>hong</w>
|
||||
<w>ivoire</w>
|
||||
<w>jawira</w>
|
||||
<w>keycap</w>
|
||||
<w>kitts</w>
|
||||
<w>kosovo</w>
|
||||
<w>lanka</w>
|
||||
<w>leste</w>
|
||||
<w>maarten</w>
|
||||
<w>mahjong</w>
|
||||
<w>marino</w>
|
||||
<w>mayen</w>
|
||||
<w>mayotte</w>
|
||||
<w>melilla</w>
|
||||
<w>mens</w>
|
||||
<w>merperson</w>
|
||||
<w>miquelon</w>
|
||||
<w>moai</w>
|
||||
<w>nazar</w>
|
||||
<w>niue</w>
|
||||
<w>oclock</w>
|
||||
<w>oden</w>
|
||||
<w>oneline</w>
|
||||
<w>palau</w>
|
||||
<w>papua</w>
|
||||
<w>petri</w>
|
||||
<w>phing</w>
|
||||
<w>piñata</w>
|
||||
<w>plantuml</w>
|
||||
<w>príncipe</w>
|
||||
<w>réunion</w>
|
||||
<w>selfie</w>
|
||||
<w>sint</w>
|
||||
<w>smilies</w>
|
||||
<w>spoked</w>
|
||||
<w>supervillain</w>
|
||||
<w>symplify</w>
|
||||
<w>tanabata</w>
|
||||
<w>timor</w>
|
||||
<w>tokelau</w>
|
||||
<w>tomé</w>
|
||||
<w>womans</w>
|
||||
<w>womens</w>
|
||||
<w>zealand</w>
|
||||
<w>åland</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhingConfiguration">
|
||||
<buildFilePaths>
|
||||
<buildFile path="file://$PROJECT_DIR$/build.xml" />
|
||||
</buildFilePaths>
|
||||
<phingPath>/usr/local/bin/phing</phingPath>
|
||||
</component>
|
||||
</project>
|
64
CHANGELOG.md
64
CHANGELOG.md
|
@ -1,64 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
<!--
|
||||
### Added
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
### Security
|
||||
-->
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [v2.0.1] - 2020-09-17
|
||||
|
||||
### Changed
|
||||
|
||||
- [#8] Cleaning Emoji class removing comments, from 468K to 157K.
|
||||
|
||||
## [v2.0.0] - 2020-03-12
|
||||
|
||||
### Changed
|
||||
|
||||
- [#6] Update to emoji v13
|
||||
|
||||
## [v1.2.0] - 2019-10-28
|
||||
|
||||
### Changed
|
||||
|
||||
- [#5] Updated to Emoji v12.1
|
||||
|
||||
## [v1.1.0] - 2019-10-02
|
||||
|
||||
### Added
|
||||
|
||||
- [#1] Added catalog with the list of all emojis
|
||||
|
||||
## [v1.0.0] - 2019-10-01
|
||||
|
||||
### Added
|
||||
|
||||
- [#2] Added docblock with _name_ and _code point_ to all constants.
|
||||
|
||||
### Changed
|
||||
|
||||
- [#2] Constant `Emoji::LAPTOP_COMPUTER` was changed to `Emoji::LAPTOP`.
|
||||
- [#2] Constant `Emoji::FLAG_ENGLAND` was changed to `Emoji::FLAG_GBENG`.
|
||||
- [#2] Constant `Emoji::FLAG_SCOTLAND` was changed to `Emoji::FLAG_GBSCT`.
|
||||
- [#2] Constant `Emoji::FLAG_WALES` was changed to `Emoji::FLAG_GBWLS`.
|
||||
|
||||
## [v0.0.0] - 2019-08-30
|
||||
|
||||
### Added
|
||||
|
||||
- First working version.
|
||||
|
||||
[#2]: https://github.com/jawira/emoji-catalo/pull/2
|
||||
[v1.0.0]: https://github.com/jawira/emoji-catalo/compare/v0.0.0...v1.0.0
|
||||
[#1]: https://github.com/jawira/emoji-catalo/pull/1
|
||||
[v1.1.0]: https://github.com/jawira/emoji-catalo/compare/v1.0.0...v1.1.0
|
||||
[#5]: https://github.com/jawira/emoji-catalo/pull/5
|
||||
[v1.2.0]: https://github.com/jawira/emoji-catalo/compare/v1.1.0...v1.2.0
|
||||
[#6]: https://github.com/jawira/emoji-catalog/pull/6
|
||||
[v2.0.0]: https://github.com/jawira/emoji-catalog/compare/v1.2.0...v2.0.0
|
|
@ -1,51 +0,0 @@
|
|||
Contributing
|
||||
============
|
||||
|
||||
Contributions in the form of **✍Issues** and **🛠Pull requests** are welcomed
|
||||
and encouraged.
|
||||
|
||||
How to contribute
|
||||
-----------------
|
||||
|
||||
In order to contribute to this project:
|
||||
|
||||
1. **Fork** this repository
|
||||
2. Create a **new branch** and commit your feature or bugfix
|
||||
3. Once you have finished, create a **Pull Request** to merge your changes into
|
||||
remote's develop branch
|
||||
|
||||
Do not forget to add your name at the end of this file.
|
||||
|
||||
Recommendations
|
||||
---------------
|
||||
|
||||
This project adheres to:
|
||||
|
||||
* [Contributor Covenant]: A Code of Conduct for Open Source Projects
|
||||
* [Keep a Changelog]: Good practices for changelog file
|
||||
* [pds/skeleton]: Standard PHP package skeleton
|
||||
* [Vincent Driessen's branching model]: A branching model for Git
|
||||
* [Semantic Versioning]: Simple rules for version numbers
|
||||
|
||||
It's encouraged to use:
|
||||
|
||||
* [The seven rules of a great Git commit message]: How to Write a good Git
|
||||
Commit Message
|
||||
* [git-flow]: Git extensions to provide high-level repository operations for
|
||||
Vincent Driessen's branching model
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
The following individuals have contributed to this project:
|
||||
|
||||
- (add your name here)
|
||||
|
||||
|
||||
[Contributor Covenant]: https://www.contributor-covenant.org/
|
||||
[git-flow]: https://danielkummer.github.io/git-flow-cheatsheet/
|
||||
[Keep a Changelog]: http://keepachangelog.com/en/1.0.0/
|
||||
[pds/skeleton]: https://github.com/php-pds/skeleton
|
||||
[Semantic Versioning]: http://semver.org/
|
||||
[The seven rules of a great Git commit message]: https://chris.beams.io/posts/git-commit/#seven-rules
|
||||
[Vincent Driessen's branching model]: http://nvie.com/posts/a-successful-git-branching-model/
|
77
README.md
77
README.md
|
@ -1,7 +1,6 @@
|
|||
Emoji catalog 📔
|
||||
==============
|
||||
# Emoji catalog 📔
|
||||
|
||||
Get access to +3300 emojis as class constants.
|
||||
Get access to +3600 emojis as class constants.
|
||||
|
||||
Features:
|
||||
|
||||
|
@ -12,16 +11,9 @@ Features:
|
|||
You can see the [full emoji list].
|
||||
|
||||
[![Latest Stable Version](https://poser.pugx.org/jawira/emoji-catalog/v/stable)](https://packagist.org/packages/jawira/emoji-catalog)
|
||||
[![Emoji version](https://img.shields.io/badge/Emoji-v13.0-%23ff69b4)](https://home.unicode.org/unicode-emoji-13-0-now-final-for-2020/)
|
||||
[![Total Downloads](https://poser.pugx.org/jawira/emoji-catalog/downloads)](https://packagist.org/packages/jawira/emoji-catalog)
|
||||
[![License](https://poser.pugx.org/jawira/emoji-catalog/license)](https://packagist.org/packages/jawira/emoji-catalog)
|
||||
[![composer.lock](https://poser.pugx.org/jawira/emoji-catalog/composerlock)](https://packagist.org/packages/jawira/emoji-catalog)
|
||||
[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg)](https://github.com/php-pds/skeleton)
|
||||
[![Issues](https://img.shields.io/github/issues/jawira/emoji-catalog.svg?label=HuBoard&color=694DC2)](https://huboard.com/jawira/emoji-catalog)
|
||||
[![HitCount](http://hits.dwyl.io/jawira/emoji-catalog.svg)](http://hits.dwyl.io/jawira/emoji-catalog)
|
||||
|
||||
Usage
|
||||
-----
|
||||
## Usage
|
||||
|
||||
You have access to emojis as `\Jawira\EmojiCatalog\Emoji` constants:
|
||||
|
||||
|
@ -35,48 +27,71 @@ echo Emoji::HOURGLASS_DONE; // ⌛
|
|||
echo Emoji::EJECT_BUTTON; // ⏏
|
||||
```
|
||||
|
||||
Your favorite IDE should give you autocomplete since you are simply calling
|
||||
Your favorite IDE should give you autocomplete since you are simply calling
|
||||
class constants:
|
||||
|
||||
![Autocomplete](docs/images/autocomplete.png)
|
||||
|
||||
How to install
|
||||
--------------
|
||||
## How to install
|
||||
|
||||
```
|
||||
$ composer require jawira/emoji-catalog
|
||||
```
|
||||
|
||||
Contributing
|
||||
------------
|
||||
## Emoji sequences
|
||||
|
||||
If you liked this project, ⭐ star it on [GitHub].
|
||||
An _emoji sequence_ is an emoji composed of other emojis. For example the
|
||||
character "👨👩👧" is composed of five characters: _U+1F468 U+200D U+1F469
|
||||
U+200D U+1F467_.
|
||||
|
||||
License
|
||||
-------
|
||||
You don't need to compose your emojis, _jawira/emoji-catalog_ comes with all
|
||||
possible sequences as class constants:
|
||||
|
||||
```php
|
||||
echo Emoji::FAMILY_MAN_WOMAN_GIRL; // 👨👩👧
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
- If you liked this project, ⭐ star it on [GitHub]
|
||||
. [![GitHub Repo stars](https://img.shields.io/github/stars/jawira/emoji-catalog?style=social)][GitHub]
|
||||
- Or follow me on
|
||||
Twitter. [![Twitter Follow](https://img.shields.io/twitter/follow/jawira?style=social)](https://twitter.com/jawira)
|
||||
|
||||
## License
|
||||
|
||||
This library is licensed under the [MIT license](LICENSE.md).
|
||||
|
||||
[GitHub]: https://github.com/jawira/emoji-catalog
|
||||
|
||||
[full emoji list]: https://github.com/jawira/emoji-catalog/blob/master/docs/catalog.md
|
||||
|
||||
***
|
||||
|
||||
Packages from jawira
|
||||
--------------------
|
||||
## Packages from jawira
|
||||
|
||||
<dl>
|
||||
<dt><a href="https://packagist.org/packages/jawira/case-converter">jawira/case-converter</a> (library)</dt>
|
||||
<dd>Convert strings between 13 naming conventions: Snake case, Camel case,
|
||||
Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case,
|
||||
Upper case, Lower case, Sentence case, Title case and Dot notation.
|
||||
</dd>
|
||||
|
||||
<dt><a href="https://packagist.org/packages/jawira/plantuml">jawira/plantuml</a> (library)</dt>
|
||||
<dd>Provides PlantUML integration: plantuml executable and plantuml.jar</dd>
|
||||
<dt>
|
||||
<a href="https://packagist.org/packages/jawira/plantuml">jawira/plantuml
|
||||
<img alt="GitHub stars" src="https://badgen.net/github/stars/jawira/plantuml?icon=github"/></a>
|
||||
</dt>
|
||||
<dd>Provides PlantUML executable and plantuml.jar</dd>
|
||||
|
||||
<dt><a href="https://packagist.org/packages/jawira/plantuml-encoding">jawira/plantuml-encoding</a> (library)</dt>
|
||||
<dd>PlantUML encoding functions.</dd>
|
||||
<dt>
|
||||
<a href="https://packagist.org/packages/jawira/plantuml-encoding"> jawira/plantuml-encoding
|
||||
<img alt="GitHub stars" src="https://badgen.net/github/stars/jawira/plantuml-encoding?icon=github"/></a>
|
||||
</dt>
|
||||
<dd>PlantUML encoding functions.</dd>
|
||||
|
||||
<dt><a href="https://packagist.org/packages/jawira/">more...</a></dt>
|
||||
<dt>
|
||||
<a href="https://packagist.org/packages/jawira/case-converter">jawira/case-converter
|
||||
<img alt="GitHub stars" src="https://badgen.net/github/stars/jawira/case-converter?icon=github"/></a>
|
||||
</dt>
|
||||
<dd>Convert strings between 13 naming conventions: Snake case, Camel case,
|
||||
Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case,
|
||||
Upper case, Lower case, Sentence case, Title case and Dot notation.
|
||||
</dd>
|
||||
|
||||
<dt><a href="https://packagist.org/packages/jawira/">More...</a></dt>
|
||||
</dl>
|
||||
|
|
BIN
build.png
BIN
build.png
Binary file not shown.
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 44 KiB |
167
build.xml
167
build.xml
|
@ -1,25 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="jawira/emoji-catalog" default="help" phingVersion="3">
|
||||
|
||||
<project name="Emoji catalog" default="help" phingVersion="3">
|
||||
|
||||
<defaultexcludes default="true"/><!--Initializing default excludes-->
|
||||
<defaultexcludes add="**/.idea"/>
|
||||
<defaultexcludes add="**/.idea/**"/>
|
||||
<property name="phing.http.proxy" value="${env.http_proxy}"/>
|
||||
<property name="emoji.source" value="https://unicode.org/Public/emoji/15.0/emoji-test.txt"/>
|
||||
|
||||
<target name="help">
|
||||
<exec executable="xdg-open" spawn="true">
|
||||
<arg path="build.png"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="setup" description="Prepare project for dev" depends="composer:install, phing:visualizer"/>
|
||||
<target name="qa" description="Quality assurance" depends="composer:validate, php:lint"/>
|
||||
<target name="update" description="Update class and catalog" depends="emoji:update, catalog:update"/>
|
||||
<target name="emoji:update" description="Update Emoji.php"
|
||||
depends="emoji-list:download, emoji:parse, emoji:build, emoji:clean"/>
|
||||
<target name="catalog:update" description="Update catalog.md"
|
||||
depends="emoji-list:download, catalog:parse, catalog:build"/>
|
||||
<target name="setup" description="Prepare project for dev" depends="composer:install"/>
|
||||
<target name="qa" description="Quality assurance"
|
||||
depends="composer:normalize,composer:validate,php:lint,emoji:tests"/>
|
||||
<target name="update" description="Update class and catalog"
|
||||
depends="emoji:download-source,emoji:update,doc:update,emoji:count"/>
|
||||
|
||||
|
||||
<target name="composer:validate" description="Validate composer.json">
|
||||
<composer command="validate">
|
||||
|
@ -30,12 +21,9 @@
|
|||
</composer>
|
||||
</target>
|
||||
|
||||
<target name="phing:visualizer">
|
||||
<visualizer/>
|
||||
</target>
|
||||
|
||||
<target name="composer:install" description="Install for dev">
|
||||
<composer command="install">
|
||||
<arg value="--quiet"/>
|
||||
<arg value="--no-suggest"/>
|
||||
<arg value="--no-interaction"/>
|
||||
<arg value="--profile"/>
|
||||
|
@ -43,117 +31,70 @@
|
|||
</composer>
|
||||
</target>
|
||||
|
||||
<target name="git:tag-listing" description="List all git tags">
|
||||
<!--https://stackoverflow.com/a/34239190/4345061-->
|
||||
<exec executable="git" passthru="true">
|
||||
<arg value="log"/>
|
||||
<arg line="--graph --all --decorate --oneline --simplify-by-decoration"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="changelog:links" description="Update links in composer.json">
|
||||
<composer command="require">
|
||||
<arg value="symplify/changelog-linker"/>
|
||||
</composer>
|
||||
<exec executable="vendor/bin/changelog-linker">
|
||||
<arg value="link"/>
|
||||
</exec>
|
||||
<composer command="remove">
|
||||
<arg value="symplify/changelog-linker"/>
|
||||
<target name="composer:normalize" description="Normalize composer.json">
|
||||
<composer command="normalize">
|
||||
<arg value="--ansi"/>
|
||||
<arg value="--no-interaction"/>
|
||||
<arg value="--diff"/>
|
||||
<arg value="--indent-size=2"/>
|
||||
<arg value="--indent-style=space"/>
|
||||
</composer>
|
||||
</target>
|
||||
|
||||
<target name="emoji-list:download">
|
||||
<mkdir dir="resources/unicode/"/>
|
||||
<httpget dir="resources/unicode/" url="https://unicode.org/emoji/charts/full-emoji-list.html"/>
|
||||
<httpget dir="resources/unicode/" url="https://unicode.org/emoji/charts/full-emoji-modifiers.html"/>
|
||||
<target name="emoji:download-source">
|
||||
<mkdir dir="resources/unicode"/>
|
||||
<httpget dir="resources/unicode" url="${emoji.source}"/>
|
||||
</target>
|
||||
|
||||
<target name="emoji:parse">
|
||||
<mkdir dir="resources/output"/>
|
||||
<delete file="resources/output/emoji-1.txt"/>
|
||||
<xslt file="resources/unicode/full-emoji-list.html"
|
||||
tofile="resources/output/emoji-1.txt"
|
||||
style="resources/xslt/emoji.xsl"
|
||||
haltonerror="false"
|
||||
overwrite="true"
|
||||
html="true"/>
|
||||
|
||||
<delete file="resources/output/emoji-2.txt"/>
|
||||
<xslt file="resources/unicode/full-emoji-modifiers.html"
|
||||
tofile="resources/output/emoji-2.txt"
|
||||
style="resources/xslt/emoji.xsl"
|
||||
haltonerror="false"
|
||||
overwrite="true"
|
||||
html="true"/>
|
||||
<target name="emoji:update" description="Generate Emoji class">
|
||||
<autoloader autoloaderpath="vendor/autoload.php"/>
|
||||
<taskdef name="emoji-update" classname="\Jawira\EmojiTask\EmojiUpdateTask"/>
|
||||
<emoji-update/>
|
||||
</target>
|
||||
|
||||
<target name="emoji:build">
|
||||
<append file="resources/templates/emoji-header.php.dist" destFile="src/Emoji.php" append="false" overwrite="true"/>
|
||||
<append file="resources/output/emoji-1.txt" destFile="src/Emoji.php"/>
|
||||
<append file="resources/output/emoji-2.txt" destFile="src/Emoji.php"/>
|
||||
<append file="resources/templates/emoji-footer.php.dist" destFile="src/Emoji.php"/>
|
||||
</target>
|
||||
|
||||
<target name="emoji:clean" description="Reduce Emoji.php size">
|
||||
<reflexive file="src/Emoji.php">
|
||||
<filterchain>
|
||||
<stripphpcomments/>
|
||||
<linecontainsregexp>
|
||||
<regexp pattern="\S"/>
|
||||
</linecontainsregexp>
|
||||
</filterchain>
|
||||
</reflexive>
|
||||
</target>
|
||||
|
||||
<target name="catalog:parse">
|
||||
<mkdir dir="resources/output"/>
|
||||
<delete file="resources/output/catalog-1.txt"/>
|
||||
<xslt file="resources/unicode/full-emoji-list.html"
|
||||
tofile="resources/output/catalog-1.txt"
|
||||
style="resources/xslt/catalog.xsl"
|
||||
haltonerror="false"
|
||||
overwrite="true"
|
||||
html="true"/>
|
||||
|
||||
<delete file="resources/output/catalog-2.txt"/>
|
||||
<xslt file="resources/unicode/full-emoji-modifiers.html"
|
||||
tofile="resources/output/catalog-2.txt"
|
||||
style="resources/xslt/catalog.xsl"
|
||||
haltonerror="false"
|
||||
overwrite="true"
|
||||
html="true"/>
|
||||
</target>
|
||||
|
||||
<target name="catalog:build">
|
||||
<append file="resources/templates/catalog-header.md.dist" destFile="docs/catalog.md" append="false"
|
||||
overwrite="true"/>
|
||||
<append file="resources/output/catalog-1.txt" destFile="docs/catalog.md"/>
|
||||
<append file="resources/output/catalog-2.txt" destFile="docs/catalog.md"/>
|
||||
<target name="doc:update">
|
||||
<autoloader autoloaderpath="vendor/autoload.php"/>
|
||||
<taskdef name="catalog-update" classname="\Jawira\EmojiTask\CatalogUpdateTask"/>
|
||||
<catalog-update/>
|
||||
</target>
|
||||
|
||||
<target name="php:lint" description="Check PHP syntax">
|
||||
<phplint deprecatedAsError="true">
|
||||
<phplint deprecatedAsError="true" haltonfailure="true">
|
||||
<fileset dir="src">
|
||||
<include name="**/*.php"/>
|
||||
</fileset>
|
||||
</phplint>
|
||||
</target>
|
||||
|
||||
<target name="emoji:tests" description="Test some fully-qualified emojis">
|
||||
<autoloader autoloaderpath="vendor/autoload.php"/>
|
||||
<php function="vanilla"/>
|
||||
</target>
|
||||
|
||||
<target name="emoji:count" description="Count constants in Emoji class">
|
||||
<autoloader autoloaderpath="vendor/autoload.php"/>
|
||||
<adhoc-task name="emoji-count"><![CDATA[
|
||||
class EmojiCountTask extends Task {
|
||||
function main() {
|
||||
$emojiReflection = new ReflectionClass(\Jawira\EmojiCatalog\Emoji::class);
|
||||
$constants = $emojiReflection->getConstants();
|
||||
$count = count($constants);
|
||||
$this->log("Emoji count: $count");
|
||||
$this->project->setProperty('emoji-count', $count);
|
||||
<adhoc-task name="emoji-count">
|
||||
class EmojiCountTask extends \Phing\Task {
|
||||
function main() {
|
||||
$emojiReflection = new ReflectionClass(\Jawira\EmojiCatalog\Emoji::class);
|
||||
$constants = $emojiReflection->getConstants();
|
||||
$count = count($constants);
|
||||
$this->log("Emoji count: $count");
|
||||
$this->project->setProperty('emoji-count', $count);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></adhoc-task>
|
||||
</adhoc-task>
|
||||
<emoji-count/>
|
||||
</target>
|
||||
|
||||
<target name="help">
|
||||
<uptodate property="uptodate.visualizer" srcfile="build.xml" targetfile="build.png"/>
|
||||
<runtarget target="visualizer"/>
|
||||
<open path="build.png"/>
|
||||
</target>
|
||||
|
||||
<target name="visualizer" unless="uptodate.visualizer" description="Create buildfile map">
|
||||
<visualizer/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"name": "jawira/emoji-catalog",
|
||||
"description": "Get access to +3600 emojis as class constants",
|
||||
"license": "MIT",
|
||||
"type": "library",
|
||||
"description": "Get access to +3300 emojis as class constants",
|
||||
"keywords": [
|
||||
"emoji",
|
||||
"emojis",
|
||||
|
@ -11,24 +12,39 @@
|
|||
"unicode",
|
||||
"catalog"
|
||||
],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jawira Portugal",
|
||||
"email": "dev@tugal.be"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"require-dev": {},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
"require-dev": {
|
||||
"php": "^7.3 || ^8.0",
|
||||
"ext-intl": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ergebnis/composer-normalize": "^2.28",
|
||||
"jawira/skeleton": "^2.16",
|
||||
"phing/phing": "^2.17 || ^3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Jawira\\EmojiCatalog\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Jawira\\EmojiTask\\": "tasks"
|
||||
},
|
||||
"files": [
|
||||
"tests/vanilla.php"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"ergebnis/composer-normalize": true
|
||||
},
|
||||
"platform-check": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
|
|
6966
docs/catalog.md
6966
docs/catalog.md
File diff suppressed because it is too large
Load Diff
|
@ -1,32 +0,0 @@
|
|||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:variable name="end" select="14"/>
|
||||
<xsl:variable name="increment" select="1"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<table>
|
||||
<xsl:for-each select="//record">
|
||||
<tr>
|
||||
<xsl:variable name="start" select="1"/>
|
||||
<xsl:call-template name="loop">
|
||||
<xsl:with-param name="counter" select="$start"/>
|
||||
</xsl:call-template>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="loop">
|
||||
<xsl:param name="counter"/>
|
||||
<xsl:if test="$counter <= $end">
|
||||
<td>
|
||||
<xsl:value-of select="Merkmale/Product/Merkmal[@ColNo=$counter]/@Farbe"/>
|
||||
</td>
|
||||
<xsl:call-template name="loop">
|
||||
<xsl:with-param name="counter" select="$counter + $increment"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,7 +1,6 @@
|
|||
Catalog
|
||||
=======
|
||||
# Emoji Catalog
|
||||
|
||||
This list contains all the _emojis_ from `\Jawira\EmojiCatalog\Emoji`.
|
||||
|
||||
| Name | Emoji | Code point(s) | `\Jawira\EmojiCatalog\Emoji::`
|
||||
| --------- | --------- | ------------- | -------------------------------
|
||||
| Name | Emoji | Code point(s) | `\Jawira\EmojiCatalog\Emoji::` |
|
||||
| --------- | --------- | ------------- | ------------------------------- |
|
||||
|
|
|
@ -3,11 +3,8 @@
|
|||
namespace Jawira\EmojiCatalog;
|
||||
|
||||
/**
|
||||
* Class Emoji
|
||||
*
|
||||
* Get access to all emojis as class constants.
|
||||
*
|
||||
* @package Jawira\EmojiCatalog
|
||||
* @author Jawira Portugal <dev@tugal.be>
|
||||
*/
|
||||
class Emoji
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output method="text" version="2.0" encoding="UTF-8" indent="no"/>
|
||||
<xsl:include href="./resources/xslt/common.xsl"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:for-each select="//table//tr[./td//img]">
|
||||
<xsl:text>| </xsl:text>
|
||||
<xsl:call-template name="get-name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text>| </xsl:text>
|
||||
<xsl:call-template name="get-emoji"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text>| </xsl:text>
|
||||
<xsl:call-template name="get-code"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text>| </xsl:text>
|
||||
<xsl:call-template name="get-constant-name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,95 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:template name="get-code">
|
||||
<xsl:value-of select="./td[2]//a/text()"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="get-name">
|
||||
<xsl:variable name="short-name" select="./td[last()]/text()"/>
|
||||
<xsl:variable name="removable" select="'⊛⊖'"/>
|
||||
<xsl:variable name="cleaned" select="translate($short-name, $removable, '')"/>
|
||||
<xsl:value-of select="normalize-space($cleaned)"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="get-emoji">
|
||||
<xsl:value-of select="./td[3]/text()"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="get-constant-name">
|
||||
<xsl:variable name="short-name" select="./td[last()]/text()"/>
|
||||
<xsl:variable name="removable" select="':;.,⊛’!“”()⊖'"/>
|
||||
<xsl:variable name="cleaned" select="translate($short-name, $removable, '')"/>
|
||||
<xsl:variable name="lowercase" select="'Åãabcçdeéfghíijklmnñoôpqrstuvwxyz-&'"/>
|
||||
<xsl:variable name="uppercase" select="'AAABCCDEEFGHIIJKLMNNOOPQRSTUVWXYZ N'"/>
|
||||
<xsl:variable name="no-accents" select="translate($cleaned, $lowercase, $uppercase)"/>
|
||||
<xsl:variable name="normalized" select="normalize-space($no-accents)"/>
|
||||
<xsl:variable name="no-spaces" select="translate($normalized, ' ', '_')"/>
|
||||
|
||||
<xsl:variable name="no-1st">
|
||||
<xsl:call-template name="string-replace-all">
|
||||
<xsl:with-param name="text" select="$no-spaces"/>
|
||||
<xsl:with-param name="replace" select="'1ST'"/>
|
||||
<xsl:with-param name="by" select="'FIRST'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="no-2nd">
|
||||
<xsl:call-template name="string-replace-all">
|
||||
<xsl:with-param name="text" select="$no-1st"/>
|
||||
<xsl:with-param name="replace" select="'2ND'"/>
|
||||
<xsl:with-param name="by" select="'SECOND'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="no-3rd">
|
||||
<xsl:call-template name="string-replace-all">
|
||||
<xsl:with-param name="text" select="$no-2nd"/>
|
||||
<xsl:with-param name="replace" select="'3RD'"/>
|
||||
<xsl:with-param name="by" select="'THIRD'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="no-number">
|
||||
<xsl:call-template name="string-replace-all">
|
||||
<xsl:with-param name="text" select="$no-3rd"/>
|
||||
<xsl:with-param name="replace" select="'#'"/>
|
||||
<xsl:with-param name="by" select="'NUMBER'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="no-asterisk">
|
||||
<xsl:call-template name="string-replace-all">
|
||||
<xsl:with-param name="text" select="$no-number"/>
|
||||
<xsl:with-param name="replace" select="'*'"/>
|
||||
<xsl:with-param name="by" select="'ASTERISK'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:value-of select="$no-asterisk"/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx -->
|
||||
<xsl:template name="string-replace-all">
|
||||
<xsl:param name="text"/>
|
||||
<xsl:param name="replace"/>
|
||||
<xsl:param name="by"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($text, $replace)">
|
||||
<xsl:value-of select="substring-before($text,$replace)"/>
|
||||
<xsl:value-of select="$by"/>
|
||||
<xsl:call-template name="string-replace-all">
|
||||
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
|
||||
<xsl:with-param name="replace" select="$replace"/>
|
||||
<xsl:with-param name="by" select="$by"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$text"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output method="text" version="2.0" encoding="UTF-8" indent="no"/>
|
||||
<xsl:include href="./resources/xslt/common.xsl"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:for-each select="//table//tr[./td//img]">
|
||||
<xsl:text> /** </xsl:text>
|
||||
<xsl:text> * </xsl:text>
|
||||
<xsl:call-template name="get-name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text> * </xsl:text>
|
||||
<xsl:text> * Code point(s): </xsl:text>
|
||||
<xsl:call-template name="get-code"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text> */ </xsl:text>
|
||||
<xsl:text> const </xsl:text>
|
||||
<xsl:call-template name="get-constant-name"/>
|
||||
<xsl:text> = "</xsl:text>
|
||||
<xsl:call-template name="get-emoji"/>
|
||||
<xsl:text>"; </xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
6970
src/Emoji.php
6970
src/Emoji.php
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,27 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Jawira\EmojiTask;
|
||||
|
||||
abstract class AbstractEmojiTask extends \Phing\Task
|
||||
{
|
||||
function codepointsToEmoji(string $codepoints): string
|
||||
{
|
||||
$codepointsArray = array_filter(explode(' ', $codepoints));
|
||||
$reducer = function (string $carry, string $codepoint) {
|
||||
return $carry . mb_chr(hexdec($codepoint), 'UTF-8');
|
||||
};
|
||||
return array_reduce($codepointsArray, $reducer, '');
|
||||
}
|
||||
|
||||
function extractParts(string $line): ?array
|
||||
{
|
||||
preg_match('@^(?<CODEPOINTS>[0-9A-H\s]+); fully-qualified\s+#\s\S+\sE\d*\.\d*\s(?<NAME>.+)@', $line, $matches);
|
||||
return empty($matches) ? null : $matches;
|
||||
}
|
||||
|
||||
function normalizeEmojiName(string $emojiName): string
|
||||
{
|
||||
$rules = "'*' > asterisk ; '#' > number ; :: Any-Latin; :: NFD; :: [:Nonspacing Mark:] Remove; :: NFC; :: [^-[:^Punctuation:]] Remove; :: Upper(); [:^L:] { [-] > ; [-] } [:^L:] > ; [-[:Separator:]]+ > '_'; 1ST > FIRST ; 2ND > SECOND ; 3RD > THIRD ; ";
|
||||
return \Transliterator::createFromRules($rules)->transliterate($emojiName);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Jawira\EmojiTask;
|
||||
|
||||
use SplFileObject;
|
||||
|
||||
class CatalogUpdateTask extends AbstractEmojiTask
|
||||
{
|
||||
function main()
|
||||
{
|
||||
$file = new SplFileObject('docs/catalog.md', 'w+');
|
||||
$file->fwrite(file_get_contents('resources/templates/catalog-header.md.dist'));
|
||||
foreach (file('resources/unicode/emoji-test.txt') as $line) {
|
||||
$matches = $this->extractParts($line);
|
||||
if (!is_array($matches)) {
|
||||
continue;
|
||||
}
|
||||
$emoji = $this->codepointsToEmoji($matches['CODEPOINTS']);
|
||||
$constantName = $this->normalizeEmojiName($matches['NAME']);
|
||||
$file->fwrite(sprintf("| %s | %s | %s | %s |%s", $matches['NAME'], $emoji, trim($matches['CODEPOINTS']), $constantName, PHP_EOL));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Jawira\EmojiTask;
|
||||
|
||||
use SplFileObject;
|
||||
|
||||
class EmojiUpdateTask extends AbstractEmojiTask
|
||||
{
|
||||
function main()
|
||||
{
|
||||
$file = new SplFileObject('src/Emoji.php', 'w+');
|
||||
$file->fwrite(file_get_contents('resources/templates/emoji-header.php.dist'));
|
||||
foreach (file('resources/unicode/emoji-test.txt') as $line) {
|
||||
$matches = $this->extractParts($line);
|
||||
if (!is_array($matches)) {
|
||||
continue;
|
||||
}
|
||||
$emoji = $this->codepointsToEmoji($matches['CODEPOINTS']);
|
||||
$constantName = $this->normalizeEmojiName($matches['NAME']);
|
||||
$file->fwrite("const $constantName = '$emoji';" . PHP_EOL);
|
||||
}
|
||||
$file->fwrite(file_get_contents('resources/templates/emoji-footer.php.dist'));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Jawira\EmojiCatalog\Emoji;
|
||||
|
||||
/**
|
||||
* Simply test if some Emojis are respected.
|
||||
*
|
||||
* Since Emojis can have different names between versions, update tests accordingly.
|
||||
*/
|
||||
function vanilla()
|
||||
{
|
||||
$provider = [
|
||||
'E0.6' => [Emoji::VICTORY_HAND, "\u{270C}\u{FE0F}"],
|
||||
'E0.7' => [Emoji::MOUNTAIN, "\u{26F0}\u{FE0F}"],
|
||||
'E1.0' => [Emoji::GRINNING_FACE, "\u{1F600}"],
|
||||
'E2.0' => [Emoji::FLAG_EUROPEAN_UNION, "\u{1F1EA}\u{1F1FA}"],
|
||||
'E3.0' => [Emoji::CALL_ME_HAND, "\u{1F919}"],
|
||||
'E4.0' => [Emoji::FLAG_UNITED_NATIONS, "\u{1F1FA}\u{1F1F3}"],
|
||||
'E13.1' => [Emoji::HEART_ON_FIRE, "\u{2764}\u{FE0F}\u{200D}\u{1F525}"],
|
||||
'E15.0' => [Emoji::PINK_HEART, "\u{1FA77}"],
|
||||
];
|
||||
|
||||
foreach ($provider as $key => $testCase) {
|
||||
if ($testCase[0] !== $testCase[1]) {
|
||||
throw new Exception("Test '$key' failed!");
|
||||
}
|
||||
echo $testCase[0];
|
||||
}
|
||||
$count = count($provider);
|
||||
echo PHP_EOL, "All $count tests ok!", PHP_EOL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue