Skip to content

Commit

Permalink
psr cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzap committed Aug 19, 2016
1 parent 9444fab commit da6e47c
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 55 deletions.
20 changes: 9 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
{
"name": "bosnadev/repositories",
"description": "Laravel Repositories",
"keywords": [
"laravel",
"repository",
"repositories",
"eloquent",
"database"
],
"license": "MIT",
"homepage": "https://bosnadev.com",
"keywords": ["laravel", "repository", "repositories", "eloquent", "database"],
"licence": "MIT",
"authors": [
{
"name": "Mirza Pasic",
"email": "mirza[email protected]"
"email": "mirza@bosnadev.com"
},
{
"name": "Maarten Paauw",
Expand All @@ -21,15 +17,17 @@
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "5.*",
"illuminate/database": "5.*"
"illuminate/support": "^5.2",
"illuminate/database": "^5.2",
"illuminate/filesystem": "^5.2",
"illuminate/console": "^5.2"
},
"require-dev": {
"mockery/mockery": "dev-master@dev"
},
"autoload": {
"psr-4": {
"Bosnadev\\Repositories\\": "src/"
"Bosnadev\\": "src/Bosnadev/"
}
},
"autoload-dev": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
<?php
/**
* Created by PhpStorm.
* User: maartenpaauw
* Date: 05-07-15
* Time: 16:24
*/

namespace Bosnadev\Repositories\Console\Commands\Creators;

use Doctrine\Common\Inflector\Inflector;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Config;
use Doctrine\Common\Inflector\Inflector;

/**
* Class CriteriaCreator
Expand Down Expand Up @@ -212,7 +206,7 @@ protected function getStub()
protected function getStubPath()
{
// Path
$path = __DIR__ . '/../../../resources/stubs/';
$path = __DIR__ . '/../../../../../../resources/stubs/';

// Return the path.
return $path;
Expand Down Expand Up @@ -273,4 +267,4 @@ protected function pluralizeModel()
return $model_name;
}

}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
<?php
/**
* Created by PhpStorm.
* User: maartenpaauw
* Date: 05-07-15
* Time: 14:16
*/

namespace Bosnadev\Repositories\Console\Commands\Creators;

use Doctrine\Common\Inflector\Inflector;
use Illuminate\Support\Facades\Config;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Config;
use Doctrine\Common\Inflector\Inflector;

/**
* Class RepositoryCreator
Expand Down Expand Up @@ -79,6 +73,7 @@ public function setModel($model)
*
* @param $repository
* @param $model
* @return int
*/
public function create($repository, $model)
{
Expand Down Expand Up @@ -257,7 +252,7 @@ protected function getStub()
protected function getStubPath()
{
// Stub path.
$stub_path = __DIR__ . '/../../../resources/stubs/';
$stub_path = __DIR__ . '/../../../../../../resources/stubs/';

// Return the stub path.
return $stub_path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Bosnadev\Repositories\Console\Commands;

use Bosnadev\Repositories\Console\Commands\Creators\CriteriaCreator;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Bosnadev\Repositories\Console\Commands\Creators\CriteriaCreator;

/**
* Class MakeCriteriaCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Bosnadev\Repositories\Console\Commands;

use Bosnadev\Repositories\Console\Commands\Creators\RepositoryCreator;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Bosnadev\Repositories\Console\Commands\Creators\RepositoryCreator;

/**
* Class MakeRepositoryCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Bosnadev\Repositories\Contracts;
<?php

namespace Bosnadev\Repositories\Contracts;

use Bosnadev\Repositories\Criteria\Criteria;

Expand Down Expand Up @@ -35,4 +37,4 @@ public function pushCriteria(Criteria $criteria);
* @return $this
*/
public function applyCriteria();
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php namespace Bosnadev\Repositories\Eloquent;
<?php

use Bosnadev\Repositories\Contracts\CriteriaInterface;
use Bosnadev\Repositories\Criteria\Criteria;
use Bosnadev\Repositories\Contracts\RepositoryInterface;
use Bosnadev\Repositories\Exceptions\RepositoryException;
namespace Bosnadev\Repositories\Eloquent;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Container\Container as App;
use Bosnadev\Repositories\Contracts\RepositoryInterface;
use Bosnadev\Repositories\Exceptions\RepositoryException;
use Bosnadev\Repositories\Contracts\CriteriaInterface;
use Bosnadev\Repositories\Criteria\Criteria;

/**
* Class Repository
Expand Down Expand Up @@ -315,7 +316,7 @@ public function pushCriteria(Criteria $criteria)
if ($this->preventCriteriaOverwriting) {
// Find existing criteria
$key = $this->criteria->search(function ($item) use ($criteria) {
return (is_object($item) AND (get_class($item) == get_class($criteria)));
return (is_object($item) && (get_class($item) == get_class($criteria)));
});

// Remove old criteria
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Bosnadev\Repositories\Exceptions;
<?php

namespace Bosnadev\Repositories\Exceptions;

/**
* Class RepositoryException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Bosnadev\Repositories\Providers;

use Bosnadev\Repositories\Console\Commands\Creators\CriteriaCreator;
use Bosnadev\Repositories\Console\Commands\Creators\RepositoryCreator;
use Bosnadev\Repositories\Console\Commands\MakeCriteriaCommand;
use Bosnadev\Repositories\Console\Commands\MakeRepositoryCommand;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Filesystem\FilesystemServiceProvider;
use Illuminate\Support\Composer;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\ServiceProvider;
use Bosnadev\Repositories\Console\Commands\MakeCriteriaCommand;
use Bosnadev\Repositories\Console\Commands\MakeRepositoryCommand;
use Bosnadev\Repositories\Console\Commands\Creators\CriteriaCreator;
use Bosnadev\Repositories\Console\Commands\Creators\RepositoryCreator;

/**
* Class RepositoryProvider
Expand All @@ -34,7 +33,7 @@ class RepositoryProvider extends ServiceProvider
public function boot()
{
// Config path.
$config_path = __DIR__ . '/../config/repositories.php';
$config_path = __DIR__ . '/../../../config/repositories.php';

// Publish config.
$this->publishes(
Expand Down Expand Up @@ -63,7 +62,7 @@ public function register()
$this->commands(['command.repository.make', 'command.criteria.make']);

// Config path.
$config_path = __DIR__ . '/../config/repositories.php';
$config_path = __DIR__ . '/../../../config/repositories.php';

// Merge config.
$this->mergeConfigFrom(
Expand Down
7 changes: 3 additions & 4 deletions tests/RepositoryTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php namespace Bosnadev\Tests\Repositories;
<?php

namespace Bosnadev\Tests\Repositories;

use Bosnadev\Repositories\Contracts\CriteriaInterface as Criteria;
use Bosnadev\Repositories\Contracts\RepositoryInterface as Repository;
use Illuminate\Database\Eloquent\Model;
use \Mockery as m;
use \PHPUnit_Framework_TestCase as TestCase;

Expand Down

0 comments on commit da6e47c

Please sign in to comment.