loopline-systems / closeio-api-wrapper

PHP Wrapper to use the Close.io API
MIT License
14 stars 15 forks source link

Dependency clean-up #59

Closed mavimo closed 6 years ago

mavimo commented 6 years ago

Summary

Actually we are using Doctrine inflector for string singularisation, and Zend filter for convert close.io parameter name to class name. Since the Doctrine inflector have the same feature (method classify) I like to reduce dependency by using only Doctrine inflector.

Code snippet that reproduces the problem

<?php

use Zend\Filter\Word\UnderscoreToCamelCase;
use Doctrine\Common\Inflector\Inflector;

class DemoTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider dataProvider
     */
    public function testDifference($string)
    {
        $this->assertEquals((new UnderscoreToCamelCase)->filter($string), Inflector::classify($string));
    }

    public function dataProvider()
    {
        return [
            ["date_updated"],
            ["html_url"],
            ["created_by"],
            ["organization_id"],
            ["url"],
            ["opportunities"],
            ["updated_by"],
            ["date_created"],
            ["id"],
            ["description"],
            ["id"],
            ["first_name"],
            ["last_name"],
            ["date_created"],
            ["date_updated"],
            ["email"],
            ["image"],
            ["phone"],
            ["last_used_timezone"],
        ];
    }
}

More infos