Skip to content

Commit

Permalink
Updated to 1.0.9 version
Browse files Browse the repository at this point in the history
  • Loading branch information
josantonius committed Nov 8, 2017
1 parent ba22195 commit 02fe8b5
Show file tree
Hide file tree
Showing 17 changed files with 407 additions and 155 deletions.
15 changes: 6 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
_config.yml export-ignore
.travis.yml export-ignore
CHANGELOG.md export-ignore
phpunit.xml.dist export-ignore
CONDUCT.md export-ignore
contributors.txt export-ignore
README.md export-ignore
phpcs.ruleset.xml export-ignore
README-ES.md export-ignore
phpcs.xml export-ignore
phpunit.xml export-ignore
phpmd.xml export-ignore
.travis.yml export-ignore
.editorconfig export-ignore
composer.lock export-ignore
.gitattributes export-ignore
.gitignore export-ignore
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
phpunit.xml
.git*/
vendor/
docs/*.pyc
docs/_build
build/artifacts/
composer.phar
composer.lock
composer-test.lock
build/artifacts/
vendor/
docs/_build
docs/*.pyc
.git*/
phpcbf-fixed.diff
.idea
.DS_STORE
.php_cs.cache
120 changes: 120 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?php
return \PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(array(
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['align_equals' => false, 'align_double_arrow' => false],
'blank_line_after_opening_tag' => true,
'blank_line_after_namespace' => false,
'blank_line_before_return' => true,
'cast_spaces' => true,
// 'class_keyword_remove' => true,
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => true,
'declare_strict_types' => false,
'dir_constant' => true,
'ereg_to_preg' => true,
'function_typehint_space' => true,
// 'general_phpdoc_annotation_remove' => ['author', 'category', 'package', 'copyright', 'version'],
'hash_to_slash_comment' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'indentation_type' => true,
// 'is_null' => ['use_yoda_style' => false],
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
// 'mb_str_functions' => true,
'method_separation' => true,
'modernize_types_casting' => true,
'native_function_casing' => true,
// 'native_function_invocation' => true,
'new_with_braces' => false, //
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'curly_brace_block', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'throw', 'use', 'useTrait'],
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => ['use' => 'echo'],
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'no_short_echo_tag' => false,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_construct' => true,
'php_unit_dedicate_assert' => true,
'php_unit_fqcn_annotation' => true,
'php_unit_strict' => true,
// 'phpdoc_add_missing_param_annotation' => true,
'phpdoc_align' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => ['property-read' => 'property', 'property-write' => 'property', 'type' => 'var'],
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
// 'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => false,
'phpdoc_single_line_var_spacing' => true,
// 'phpdoc_summary' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'pow_to_exponentiation' => true,
// 'pre_increment' => true,
'protected_to_private' => true,
'psr0' => true,
'psr4' => true,
'random_api_migration' => true,
'return_type_declaration' => ['space_before' => 'one'],
'self_accessor' => true,
'short_scalar_cast' => true,
// 'silenced_deprecation_error' => true,
// 'simplified_null_return' => true,
'single_blank_line_before_namespace' => false,
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
// 'strict_comparison' => true,
'ternary_operator_spaces' => true,
'strict_param' => true,
'ternary_to_null_coalescing' => false,
// 'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true
))
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
)->setLineEnding("\n");
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ language: php

sudo: false

cache:
directories:
- $HOME/.composer/cache

dist: trusty

branches:
Expand All @@ -18,7 +22,7 @@ php:
- 7.2
- hhvm
- nightly

matrix:
fast_finish: true
include:
Expand All @@ -37,7 +41,8 @@ script:
- phpunit
- |
if [[ "$PHPCS" ]] ; then
phpcs --standard=phpcs.ruleset.xml $(find . -name '*.php')
phpcs --standard=phpcs.xml $(find . -name '*.php')
phpmd src,tests text ./phpmd.xml
fi
phpunit --coverage-clover=coverage.xml
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 1.0.9 - 2017-11-08

* Implemented `PHP Mess Detector` to detect inconsistencies in code styles.

* Implemented `PHP Code Beautifier and Fixer` to fixing errors automatically.

* Implemented `PHP Coding Standards Fixer` to organize PHP code automatically according to PSR standards.

## 1.0.8 - 2017-10-30

* Implemented `PSR-4 autoloader standard` from all library files.
Expand Down
75 changes: 63 additions & 12 deletions CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,73 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
## Our Pledge

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct.
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations.
## Attribution

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
[homepage]: https://www.contributor-covenant.org
47 changes: 29 additions & 18 deletions README-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ O **instalarlo manualmente**:

$ wget https://raw.githubusercontent.com/Josantonius/PHP-Hook/master/src/Hook.php

### Métodos disponibles
## Métodos disponibles

Métodos disponibles en esta biblioteca:

Expand Down Expand Up @@ -139,7 +139,7 @@ Hook::isAction($tag);

**# Return** (boolean)

### Cómo empezar
## Cómo empezar

Para utilizar esta biblioteca, simplemente:

Expand All @@ -159,7 +159,7 @@ require_once __DIR__ . '/Hook.php';
use Josantonius\Hook\Hook;
```

### Uso
## Uso

### - Agregar gancho de acción:

Expand Down Expand Up @@ -244,7 +244,7 @@ Hook::doAction('meta', 'The title');
Hook::doAction('form', ['input', 'select']);
```

### Tests
## Tests

Para ejecutar las [pruebas](tests) necesitarás [Composer](http://getcomposer.org/download/) y seguir los siguientes pasos:

Expand All @@ -262,34 +262,45 @@ Ejecutar pruebas de estándares de código [PSR2](http://www.php-fig.org/psr/psr

$ composer phpcs

Ejecutar pruebas con [PHP Mess Detector](https://phpmd.org/) para detectar inconsistencias en el estilo de codificación:

$ composer phpmd

Ejecutar todas las pruebas anteriores:

$ composer tests

### ☑ Tareas pendientes
## ☑ Tareas pendientes

- [ ] Añadir nueva funcionalidad
- [ ] Mejorar pruebas
- [ ] Mejorar documentación
- [ ] Refactorizar código

- [x] Completar tests
- [x] Mejorar la documentación
## Contribuir

### Contribuir
Si deseas colaborar, puedes echar un vistazo a la lista de
[issues](https://github.com/Josantonius/PHP-Hook/issues) o [tareas pendientes](#-tareas-pendientes).

1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
1. Bifurca la rama del repositorio en GitHub para iniciar la operación de ajuste.
1. Escribe una o más pruebas para la nueva característica o expón el error.
1. Haz cambios en el código para implementar la característica o reparar el fallo.
1. Envía pull request para fusionar los cambios y que sean publicados.
**Pull requests**

Esto está pensado para proyectos grandes y de larga duración.
* [Fork and clone](https://help.github.com/articles/fork-a-repo).
* Ejecuta el comando `composer install` para instalar dependencias.
Esto también instalará las [dependencias de desarrollo](https://getcomposer.org/doc/03-cli.md#install).
* Ejecuta el comando `composer fix` para estandarizar el código.
* Ejecuta las [pruebas](#tests).
* Crea una nueva rama (**branch**), **commit**, **push** y envíame un
[pull request](https://help.github.com/articles/using-pull-requests).

### Repositorio
## Repositorio

Los archivos de este repositorio se crearon y subieron automáticamente con [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
La estructura de archivos de este repositorio se creó con [PHP-Skeleton](https://github.com/Josantonius/PHP-Skeleton).

### Licencia
## Licencia

Este proyecto está licenciado bajo **licencia MIT**. Consulta el archivo [LICENSE](LICENSE) para más información.

### Copyright
## Copyright

2017 Josantonius, [josantonius.com](https://josantonius.com/)

Expand Down
Loading

0 comments on commit 02fe8b5

Please sign in to comment.