Skip to content

Conversation

jcupitt
Copy link
Member

@jcupitt jcupitt commented Nov 3, 2016

possible 1.0.0 ready for review

Changes:

  • add PSR-3 logging system
  • switch to PSR-2 formatting
  • removed Enum
  • added Config and Utils
  • more tests
  • another example
kleisauke and others added 30 commits October 20, 2016 20:47
- Allow the users to define there own logging logic; with `setLogger` and `getLogger`. Following the `PSR-3 Logger Interface` standards. - Added a example how to use `setLogger`. See `examples\vips_class.php`. - `include '../src/Image.php';` didn't work in the examples. I've changed it to `require __DIR__ . '/../vendor/autoload.php';` for auto-loading. - Updated `phpunit` in `composer.json`. - Added a require for `"psr/log": "^1.0.1"` in `composer.json` to ensure that the PSR-3 interface and trait is included. - Added `PHP Parallel Lint` to check syntax of PHP files in parallel jobs. - Added a script to test the syntax of PHP files and unit tests. Usage: `composer test`. - phpcs indenting fixes. Fixes all `Whitespace found at end of line` errors. - Use the enumerations instead of the hard-coded strings. - `Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility.` following the `PSR-2: Coding Style Guide`. So I've removed those underscores. - After changing the underscores `wrap` was conflicting with the `wrap` function in libvips. I changed to `wrapResult` instead. - Added unit tests for the improved logging. (2 simple tests).
Improved logging, enumerations and more
we're now 0.9.0 as we get near 1.0
Importing enums isn't necessary because we are in the same namespace.
handy for project website
should all run in <400mb now, according to ps
there was a missing term in the equation we were using
and move the logging interface into Main
Now we are using PSR2 we no longer need useless @Version tags in every file, thank goodness.
helps phpdoc not flop about horribly on the Image class
since Image.php works now
as errorLog() and debugLog()
tests now pass
@kleisauke
Copy link
Member

I've added few inline comments. Is the version 1.0.0 still marked as experimental? If not then we can delete the EXPERIMENTAL file in the dev branch.

Overall, I think this is ready for releasing. :shipit:
(Features such as continuous integration (Travis CI), Windows support and gh-pages docs can be added in the next release, or in any further release).

src/Image.php Outdated

namespace Jcupitt\Vips;

use Psr\Log\LoggerInterface;
Copy link

Choose a reason for hiding this comment

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

LoggerInterface is no longer used in this class, so this can be removed.

* @internal
*/
private static function _errorIsArray($result)
private static function errorIsArray($result)
Copy link

Choose a reason for hiding this comment

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

This function is named contradictory IMO.

*/
public function bandor(): Image
{
// phpdoc hates OperationBoolean::OR, so use the string form here
Copy link

Choose a reason for hiding this comment

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

These kind of exceptions can't be made in phpcs configuration instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so, phpcs says that OperationBoolean::OR is a syntax error and stops parsing.

@jcupitt jcupitt merged commit 7fd21be into master Nov 4, 2016
@jcupitt
Copy link
Member Author

jcupitt commented Nov 4, 2016

OK, all comments addressed I think. I revised the README too.

I'll try to fix the memory problem in php-vips-ext before doing any publicity, and we should probably have some formatted docs up somewhere too.

@jcupitt
Copy link
Member Author

jcupitt commented Nov 4, 2016

Also, thank you both very much! Hooray!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants