Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1 modernize library #4

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

sprak3000
Copy link

Addresses Issue #1 in the following ways:

  • Adds in composer support; there is still refinement to be done if the library is hosted through packagist. Documentation has been updated to reflect how the library could be installed through composer. Enforce the library to only be used on PHP 7 or higher.
  • Use the PSR-2 coding style.
  • Moves the main search code into a namespace. Documentation has been updated to reflect how to use the library.
  • Moves the benchmark code into its own class.
  • Creates a set of phpunit based unit tests.

traack_lcruz added 6 commits October 1, 2018 10:57
* Updates the code to use PSR-2 formatting (https://www.php-fig.org/psr/psr-2/). This requires some changes to formatting of class and method names.
* Adds composer to the project. Currently only pulls in `phpunit` as a development requirement.
* Adds `phpunit` tests created from the `example.php` code along with testing the various exceptions that can be thrown.
* Some code polish based on static analysis.
* Rename class to `Search`, search method to `execute`, and push file into `src` directory. Give it a nice namespace to live in.
* Update benchmark, example, and documentation to show namespace usage.
* Add PSR-4 namespace autoload to composer.
* Move benchmarking functionality into its own class.
* Removing example PSR-4 path from composer
* Update documentation for installation via composer
* Update documentation for installation via composer
if (!isset($nodes[$u][0])) {
$nodes[$u][0] = [];
}
$nodes[$u][0] = array_merge($nodes[$u][0], $nodes[$nodes[$u][1]][0]);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static analysis identified this as another possible optimization. I haven't touched it yet where I don't have a full grasp of the code at this time and how it would relate to moving the merge process out of the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant