Skip to content

Commit

Permalink
general code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot committed Nov 10, 2014
1 parent c0078d2 commit 8c1949b
Show file tree
Hide file tree
Showing 57 changed files with 187 additions and 189 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/CacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ public function provides()
];
}

}
}
24 changes: 12 additions & 12 deletions src/Illuminate/Contracts/Routing/UrlRoutable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

interface UrlRoutable {

/**
* Get the value of the model's route key.
*
* @return mixed
*/
public function getRouteKey();
/**
* Get the value of the model's route key.
*
* @return mixed
*/
public function getRouteKey();

/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName();
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName();

}
2 changes: 1 addition & 1 deletion src/Illuminate/Cookie/CookieServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function register()
});
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Database/DatabaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,4 @@ public function __call($method, $parameters)
return call_user_func_array(array($this->connection(), $method), $parameters);
}

}
}
1 change: 0 additions & 1 deletion src/Illuminate/Database/Eloquent/Relations/MorphPivot.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,4 @@ public function setMorphClass($morphClass)
return $this;
}


}
2 changes: 1 addition & 1 deletion src/Illuminate/Database/SeedServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ public function provides()
return array('seeder', 'command.seed');
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Encryption/EncryptionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function register()
});
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Events/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public function register()
});
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Filesystem/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ protected function filterContentsByType($contents, $type)
return $value['path'];
});

return $contents->values()->all();
return $contents->values()->all();
}

/**
Expand Down
242 changes: 121 additions & 121 deletions src/Illuminate/Foundation/Publishing/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,126 +4,126 @@

abstract class Publisher {

/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;

/**
* The destination of the config files.
*
* @var string
*/
protected $publishPath;

/**
* The path to the application's packages.
*
* @var string
*/
protected $packagePath;

/**
* Create a new publisher instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param string $publishPath
* @return void
*/
public function __construct(Filesystem $files, $publishPath)
{
$this->files = $files;
$this->publishPath = $publishPath;
}

/**
* Get the source directory to publish.
*
* @param string $package
* @param string $packagePath
* @return string
*
* @throws \InvalidArgumentException
*/
abstract protected function getSource($package, $packagePath);

/**
* Publish files from a given path.
*
* @param string $package
* @param string $source
* @return bool
*/
public function publish($package, $source)
{
$destination = $this->getDestinationPath($package);

$this->makeDestination($destination);

return $this->files->copyDirectory($source, $destination);
}

/**
* Publish the files for a package.
*
* @param string $package
* @param string $packagePath
* @return bool
*/
public function publishPackage($package, $packagePath = null)
{
$source = $this->getSource($package, $packagePath ?: $this->packagePath);

return $this->publish($package, $source);
}

/**
* Create the destination directory if it doesn't exist.
*
* @param string $destination
* @return void
*/
protected function makeDestination($destination)
{
if ( ! $this->files->isDirectory($destination))
{
$this->files->makeDirectory($destination, 0777, true);
}
}

/**
* Determine if a given package has already been published.
*
* @param string $package
* @return bool
*/
public function alreadyPublished($package)
{
return $this->files->isDirectory($this->getDestinationPath($package));
}

/**
* Get the target destination path for the files.
*
* @param string $package
* @return string
*/
public function getDestinationPath($package)
{
return $this->publishPath."/packages/{$package}";
}

/**
* Set the default package path.
*
* @param string $packagePath
* @return void
*/
public function setPackagePath($packagePath)
{
$this->packagePath = $packagePath;
}
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;

/**
* The destination of the config files.
*
* @var string
*/
protected $publishPath;

/**
* The path to the application's packages.
*
* @var string
*/
protected $packagePath;

/**
* Create a new publisher instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param string $publishPath
* @return void
*/
public function __construct(Filesystem $files, $publishPath)
{
$this->files = $files;
$this->publishPath = $publishPath;
}

/**
* Get the source directory to publish.
*
* @param string $package
* @param string $packagePath
* @return string
*
* @throws \InvalidArgumentException
*/
abstract protected function getSource($package, $packagePath);

/**
* Publish files from a given path.
*
* @param string $package
* @param string $source
* @return bool
*/
public function publish($package, $source)
{
$destination = $this->getDestinationPath($package);

$this->makeDestination($destination);

return $this->files->copyDirectory($source, $destination);
}

/**
* Publish the files for a package.
*
* @param string $package
* @param string $packagePath
* @return bool
*/
public function publishPackage($package, $packagePath = null)
{
$source = $this->getSource($package, $packagePath ?: $this->packagePath);

return $this->publish($package, $source);
}

/**
* Create the destination directory if it doesn't exist.
*
* @param string $destination
* @return void
*/
protected function makeDestination($destination)
{
if ( ! $this->files->isDirectory($destination))
{
$this->files->makeDirectory($destination, 0777, true);
}
}

/**
* Determine if a given package has already been published.
*
* @param string $package
* @return bool
*/
public function alreadyPublished($package)
{
return $this->files->isDirectory($this->getDestinationPath($package));
}

/**
* Get the target destination path for the files.
*
* @param string $package
* @return string
*/
public function getDestinationPath($package)
{
return $this->publishPath."/packages/{$package}";
}

/**
* Set the default package path.
*
* @param string $packagePath
* @return void
*/
public function setPackagePath($packagePath)
{
$this->packagePath = $packagePath;
}

}
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,12 @@ function elixir($file)

if (is_null($manifest))
{
$manifest = json_decode(file_get_contents(public_path().'/build/rev-manifest.json'), true);
$manifest = json_decode(file_get_contents(public_path().'/build/rev-manifest.json'), true);
}

if (isset($manifest[$file]))
{
return '/build/'.$manifest[$file];
return '/build/'.$manifest[$file];
}

throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Hashing/HashServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function provides()
return array('hash');
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Pagination/PaginationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function register()
});
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/Console/ListenCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ protected function getOptions()
);
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Redis/RedisServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public function provides()
return array('redis');
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ protected function getEndpointsWithResourceMethods(EndpointCollection $endpoints
})->all();
}


}
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/Matching/HostValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function matches(Route $route, Request $request)
return preg_match($route->getCompiled()->getHostRegex(), $request->getHost());
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/Matching/MethodValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public function matches(Route $route, Request $request)
return in_array($request->getMethod(), $route->methods());
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/Matching/SchemeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function matches(Route $route, Request $request)
return true;
}

}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/Matching/UriValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function matches(Route $route, Request $request)
return preg_match($route->getCompiled()->getRegex(), rawurldecode($path));
}

}
}
Loading

0 comments on commit 8c1949b

Please sign in to comment.