Giter Club home page Giter Club logo

lincable's People

Contributors

jacsonfj avatar yanmarques avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ikeogu

lincable's Issues

BuildClassnames trait is failing on tests

Build failing: #15

Seems like has a mistake type received from method convertCase on trait, it is receiving string but should received an object too.

$ ./vendor/bin/phpunit   
PHPUnit 7.3-g2742185 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.16-1+ubuntu16.04.1+deb.sury.org+1
Configuration: /home/yanmarques/Documents/Projects/lincable/phpunit.xml

..............E.E.............                                    30 / 30 (100%)

Time: 74 ms, Memory: 4.00MB

There were 2 errors:

1) Tests\Lincable\Parsers\ParserTest::testThatAddFormattersAddAnArray
TypeError: Argument 1 passed to Lincable\Parsers\Parser::convertCase() must be of the type string, object given, called in /home/yanmarques/Documents/Projects/lincable/src/Lincable/Concerns/BuildClassnames.php on line 26

/home/yanmarques/Documents/Projects/lincable/src/Lincable/Concerns/BuildClassnames.php:105
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Concerns/BuildClassnames.php:26
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Parsers/Parser.php:68
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Parsers/Parser.php:107
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Parsers/Parser.php:108
/home/yanmarques/Documents/Projects/lincable/tests/Parsers/ParserTest.php:35

2) Tests\Lincable\Parsers\ParserTest::testThatParseReturnsFoo
TypeError: Argument 1 passed to Lincable\Parsers\Parser::convertCase() must be of the type string, object given, called in /home/yanmarques/Documents/Projects/lincable/src/Lincable/Concerns/BuildClassnames.php on line 26

/home/yanmarques/Documents/Projects/lincable/src/Lincable/Concerns/BuildClassnames.php:105
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Concerns/BuildClassnames.php:26
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Parsers/Parser.php:68
/home/yanmarques/Documents/Projects/lincable/tests/Parsers/ParserTest.php:63

ERRORS!
Tests: 30, Assertions: 28, Errors: 2.

Update readme

Change the readme file to be updated with new package releases.

Dependencies conflict

Installing the package with composer runs into error.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for yanmarques/lincable ^0.9.0 -> satisfiable by yanmarques/lincable[v0.9].
    - yanmarques/lincable v0.9 requires league/flysystem ^1.1@dev -> satisfiable by league/flysystem[1.1.x-dev] but these conflict with your requirements or minimum-stability.

Boot the fileRequest object when the container is resolving the class

When injecting the file request as argument on controller action, the container will resolve the class instance, but does not boot the object with the current request.

A way to workaround this is add a request argument on file request constructor and boot the it with the request, as the container will resolve the request class. Something like:

use Lincable\Http\FileRequest;

class ImageFileRequest extends FileRequest
{
    public function __construct(Request $request) 
    {
        $this->boot($request);
    }
}

The correct thing should add a function to automatically boot the file request when resolving a file request instance, we can use the container events for this.

Service provider fails on register

The register method from service provider subscribes the default upload subscriber on container dispatcher. But the configuration is not available yet when register is called.

screenshot from 2018-07-12 15-32-44

Parameter resolver on url generator

  • Add support for a global parameter resolver when generating the url with the url generator.
  • Add the key been parsed on resolver argument.

Support for uuid generation on url

  • Generate a universally unique identifier for format url.
  • We can specify the version to user.

Something like:

'urls' => [
    'foo' => 'baz/:uuidV1'
]

Find better way to test file uploads

My last commit 5e9840e that add tests for Lincable\Http\FileRequest class fails on file validation. The file I commited is failing on some debug code I forgot to remove. This is actual exception and the dump is the errors message:

➜ lincable git:(dev) ./vendor/bin/phpunit
PHPUnit 7.3-gc17423b by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.16-1+ubuntu16.04.1+deb.sury.org+1
Configuration: /home/yanmarques/Documents/Projects/lincable/phpunit.xml

.....E..................................                          40 / 40 (100%)

Time: 78 ms, Memory: 6.00MB

There was 1 error:

1) Tests\Lincable\Http\FileRequest::testThatBootSetTheRequestAndGetFileFromRequest
Illuminate\Validation\ValidationException: The given data was invalid.

/home/yanmarques/Documents/Projects/lincable/vendor/illuminate/validation/Validator.php:306
/home/yanmarques/Documents/Projects/lincable/vendor/illuminate/validation/Factory.php:136
/home/yanmarques/Documents/Projects/lincable/tests/Http/FileRequestTest.php:109
/home/yanmarques/Documents/Projects/lincable/vendor/illuminate/support/Traits/Macroable.php:107
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Http/FileRequest.php:138
/home/yanmarques/Documents/Projects/lincable/src/Lincable/Http/FileRequest.php:61
/home/yanmarques/Documents/Projects/lincable/tests/Http/FileRequestTest.php:33

ERRORS!
Tests: 40, Assertions: 40, Errors: 1.
➜  lincable git:(dev) ✗ ./vendor/bin/phpunit
PHPUnit 7.3-gc17423b by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.16-1+ubuntu16.04.1+deb.sury.org+1
Configuration: /home/yanmarques/Documents/Projects/lincable/phpunit.xml

.....array(1) {
  ["foo"]=>
  array(1) {
    [0]=>
    string(19) "validation.uploaded"
  }
}

Just looking up the code I found that the mimes validation also checks wheter the file was uploaded with PHP request. I need to find a way to send fake file on request and make the it be validated and stored (fake).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.