language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | laravel | framework | 9d796c68e4bfcba97c90c782c285fb29592e4042.json | Update Symfony displayer. | src/Illuminate/Exception/SymfonyDisplayer.php | @@ -27,10 +27,11 @@ public function __construct(ExceptionHandler $symfony)
* Display the given exception to the user.
*
* @param \Exception $exception
+ * @return \Symfony\Component\HttpFoundation\Response
*/
public function display(Exception $exception)
{
- $this->symfony->handle($exception);
+ re... | false |
Other | laravel | framework | 2044a767c3ddc6764df5f2e707cf1f67f0e06c37.json | Force the seeding
Otherwise it has to be confirmed twice. | src/Illuminate/Database/Console/Migrations/MigrateCommand.php | @@ -82,7 +82,8 @@ public function fire()
// a migration and a seed at the same time, as it is only this command.
if ($this->input->getOption('seed'))
{
- $this->call('db:seed');
+ $options = array('--force' => true);
+ $this->call('db:seed', $options);
}
}
| false |
Other | laravel | framework | 1f6f00ff8174e9422e45b6dc22fce4bbce715391.json | Use ConfirmableTrait in Seeder
Just like migrations | src/Illuminate/Database/Console/SeedCommand.php | @@ -1,11 +1,14 @@
<?php namespace Illuminate\Database\Console;
use Illuminate\Console\Command;
+use Illuminate\Console\ConfirmableTrait;
use Symfony\Component\Console\Input\InputOption;
use Illuminate\Database\ConnectionResolverInterface as Resolver;
class SeedCommand extends Command {
+ use ConfirmableTrait... | false |
Other | laravel | framework | abc7b9889be3154d400443b8a9ba0a9435157dd6.json | Use input() to get page number
Restricting page numbers to `$request->query->get()` makes it very hard to make api end points which can accept a big amount of filters via an HTTP request because there are several different limitations on how a GET request can function. Allowing current-page to be accessible via `$requ... | src/Illuminate/Pagination/Environment.php | @@ -126,7 +126,7 @@ public function getPaginationView(Paginator $paginator, $view = null)
*/
public function getCurrentPage()
{
- $page = (int) $this->currentPage ?: $this->request->query->get($this->pageName, 1);
+ $page = (int) $this->currentPage ?: $this->request->input($this->pageName, 1);
if ($page <... | false |
Other | laravel | framework | 62ccd385b89ca125f17d6ce45e3645517c6ce00a.json | Update version on master. | src/Illuminate/Foundation/Application.php | @@ -27,7 +27,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
*
* @var string
*/
- const VERSION = '4.2-dev';
+ const VERSION = '4.3-dev';
/**
* Indicates if the application has "booted". | false |
Other | laravel | framework | cd3af2a083bcb1242b9704e6c69239b47b01eafe.json | Upgrade branch alias on master branch. | composer.json | @@ -85,7 +85,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "4.2-dev"
+ "dev-master": "4.3-dev"
}
},
"suggest": {
| false |
Other | laravel | framework | 176105dcb9c222a7ca624d4bc998f1e2b5e88c8c.json | Upgrade stability on 4.2 branch. | composer.json | @@ -91,5 +91,5 @@
"suggest": {
"doctrine/dbal": "Allow renaming columns and dropping SQLite columns."
},
- "minimum-stability": "dev"
+ "minimum-stability": "beta"
}
| false |
Other | laravel | framework | c8a9c9ee9cf9b8d3137b00b02c4961b1b818033f.json | Resolve the right database connection. | src/Illuminate/Database/Migrations/Migrator.php | @@ -323,9 +323,9 @@ public function getNotes()
*
* @return \Illuminate\Database\Connection
*/
- public function resolveConnection()
+ public function resolveConnection($connection)
{
- return $this->resolver->connection($this->connection);
+ return $this->resolver->connection($connection);
}
/**
@@ -... | false |
Other | laravel | framework | 8055c87740e9709b9d733364b8544d8b3753f20d.json | Check daemon option. | src/Illuminate/Queue/Console/WorkCommand.php | @@ -50,7 +50,7 @@ public function __construct(Worker $worker)
*/
public function fire()
{
- if ($this->downForMaintenance()) return;
+ if ($this->downForMaintenance() && ! $this->option('daemon')) return;
$queue = $this->option('queue');
| false |
Other | laravel | framework | d4ef5b200985206b2e09aa409a2901ff44605a61.json | Add force root URLs. | src/Illuminate/Routing/UrlGenerator.php | @@ -19,6 +19,20 @@ class UrlGenerator {
*/
protected $request;
+ /**
+ * The force URL root.
+ *
+ * @var string
+ */
+ protected $forcedRoot;
+
+ /**
+ * The forced schema for URLs.
+ *
+ * @var string
+ */
+ protected $forceSchema;
+
/**
* Characters that should not be URL encode... | true |
Other | laravel | framework | d4ef5b200985206b2e09aa409a2901ff44605a61.json | Add force root URLs. | tests/Routing/RoutingUrlGeneratorTest.php | @@ -205,4 +205,34 @@ public function testUrlGenerationForControllers()
$this->assertEquals('http://www.foo.com:8080/foo', $url->route('foo'));
}
+
+ public function testForceRootUrl()
+ {
+ $url = new UrlGenerator(
+ $routes = new Illuminate\Routing\RouteCollection,
+ $request = Illuminate\Http\Requ... | true |
Other | laravel | framework | 32d39a0d7deb70c0dccd076f23f774b1a16976e1.json | Use new table stuff in routes command. | src/Illuminate/Foundation/Console/RoutesCommand.php | @@ -36,13 +36,6 @@ class RoutesCommand extends Command {
*/
protected $routes;
- /**
- * The table helper set.
- *
- * @var \Symfony\Component\Console\Helper\TableHelper
- */
- protected $table;
-
/**
* The table headers for the command.
*
@@ -73,8 +66,6 @@ public function __construct(Router $router)... | false |
Other | laravel | framework | 31d720672ef9698af14ed3c06a1716e61e47425b.json | Use data_get in Collection::valueRetriever | src/Illuminate/Support/Collection.php | @@ -561,7 +561,7 @@ protected function valueRetriever($value)
{
return function($item) use ($value)
{
- return is_object($item) ? $item->{$value} : array_get($item, $value);
+ return data_get($item, $value);
};
}
| true |
Other | laravel | framework | 31d720672ef9698af14ed3c06a1716e61e47425b.json | Use data_get in Collection::valueRetriever | tests/Support/SupportCollectionTest.php | @@ -358,17 +358,27 @@ public function testGroupByAttribute()
public function testGettingSumFromCollection()
{
- $c = new Collection(array((object) array('foo' => 50), (object) array('foo' => 50)));
- $this->assertEquals(100, $c->sum('foo'));
+ $c = new Collection(array((object) array('foo' => 50), (obje... | true |
Other | laravel | framework | 06c897cc683495cab67a81d4bdd180d9f554dd85.json | Fix typo in Manager.php
s/their/there | src/Illuminate/Support/Manager.php | @@ -47,7 +47,7 @@ public function driver($driver = null)
$driver = $driver ?: $this->getDefaultDriver();
// If the given driver has not been created before, we will create the instances
- // here and cache it so we can return it next time very quickly. If their is
+ // here and cache it so we can return it ne... | false |
Other | laravel | framework | 933eb1fef3d630c8d9355c72f5ffa8782cb4610c.json | Fix associate on MorphTo | src/Illuminate/Database/Eloquent/Relations/MorphTo.php | @@ -178,4 +178,19 @@ public function getDictionary()
return $this->dictionary;
}
+ /**
+ * Associate the model instance to the given parent.
+ *
+ * @param \Illuminate\Database\Eloquent\Model $model
+ * @return \Illuminate\Database\Eloquent\Model
+ */
+ public function associate(Model $model)
+ {
+ $this... | true |
Other | laravel | framework | 933eb1fef3d630c8d9355c72f5ffa8782cb4610c.json | Fix associate on MorphTo | tests/Database/DatabaseEloquentMorphToTest.php | @@ -78,6 +78,36 @@ public function testModelsAreProperlyPulledAndMatched()
}
+ public function testAssociateMethodSetsForeignKeyAndTypeOnModel()
+ {
+ $parent = m::mock('Illuminate\Database\Eloquent\Model');
+ $parent->shouldReceive('getAttribute')->once()->with('foreign_key')->andReturn('foreign.value');
+
+... | true |
Other | laravel | framework | 1fd14e97805e0eec3ed50c90798074033d1be6e9.json | Ignore Thumbs files | .gitignore | @@ -2,3 +2,4 @@
composer.phar
composer.lock
.DS_Store
+Thumbs.db
| false |
Other | laravel | framework | ff579f49370a568f8b8ad948798bd76309e85753.json | Add space after question. | src/Illuminate/Console/Command.php | @@ -177,7 +177,7 @@ public function confirm($question, $default = true)
{
$dialog = $this->getHelperSet()->get('dialog');
- return $dialog->askConfirmation($this->output, "<question>$question</question>", $default);
+ return $dialog->askConfirmation($this->output, "<question>$question</question> ", $default);
... | false |
Other | laravel | framework | 2a72b471d59cad8701a729fd99cf4b972005e8cf.json | Add subselect to query builder | src/Illuminate/Database/Query/Builder.php | @@ -206,11 +206,58 @@ public function select($columns = array('*'))
* Add a new "raw" select expression to the query.
*
* @param string $expression
+ * @param array $bindings
+ * @return \Illuminate\Database\Query\Builder|static
+ */
+ public function selectRaw($expression, array $bindings = array())
+... | true |
Other | laravel | framework | 2a72b471d59cad8701a729fd99cf4b972005e8cf.json | Add subselect to query builder | tests/Database/DatabaseQueryBuilderTest.php | @@ -1103,6 +1103,27 @@ public function testMergeBuildersBindingOrder()
}
+ public function testSubSelect()
+ {
+ $expectedSql = 'select "foo", "bar", (select "baz" from "two" where "subkey" = ?) as "sub" from "one" where "key" = ?';
+ $expectedBindings = ['subval', 'val'];
+
+ $builder = $this->getPostgresBuil... | true |
Other | laravel | framework | 15a540e6038b81b54e218e454eae98b1a2481af9.json | Fix merge conflicts. | src/Illuminate/Console/composer.json | @@ -8,6 +8,7 @@
}
],
"require": {
+ "php": ">=5.4.0",
"symfony/console": "2.5.*"
},
"require-dev": { | true |
Other | laravel | framework | 15a540e6038b81b54e218e454eae98b1a2481af9.json | Fix merge conflicts. | src/Illuminate/Http/composer.json | @@ -8,6 +8,7 @@
}
],
"require": {
+ "php": ">=5.4.0",
"illuminate/session": "4.2.*",
"illuminate/support": "4.2.*",
"symfony/http-foundation": "2.5.*", | true |
Other | laravel | framework | 15a540e6038b81b54e218e454eae98b1a2481af9.json | Fix merge conflicts. | src/Illuminate/Routing/composer.json | @@ -8,6 +8,7 @@
}
],
"require": {
+ "php": ">=5.4.0",
"illuminate/container": "4.2.*",
"illuminate/http": "4.2.*",
"illuminate/session": "4.2.*", | true |
Other | laravel | framework | 15a540e6038b81b54e218e454eae98b1a2481af9.json | Fix merge conflicts. | src/Illuminate/Workbench/composer.json | @@ -8,6 +8,7 @@
}
],
"require": {
+ "php": ">=5.4.0",
"illuminate/filesystem": "4.2.*",
"illuminate/support": "4.2.*",
"symfony/finder": "2.5.*" | true |
Other | laravel | framework | 021a892b59d42a4176cd5c0c90036c975ec547fd.json | Fix code and update change log. | src/Illuminate/Foundation/changes.json | @@ -19,7 +19,8 @@
{"message": "Destructive migration operations now require confirmation or --force when being run in production.", "backport": null},
{"message": "Added Cache::pull method for retrieving a value and then deleting it.", "backport": null},
{"message": "Added Session::pull method for retrieving a... | true |
Other | laravel | framework | 021a892b59d42a4176cd5c0c90036c975ec547fd.json | Fix code and update change log. | src/Illuminate/Pagination/Paginator.php | @@ -291,7 +291,10 @@ protected function appendArray(array $keys)
*/
public function addQuery($key, $value)
{
- $this->query[$key] = $value;
+ if ($key !== $this->factory->getPageName())
+ {
+ $this->query[$key] = $value;
+ }
return $this;
} | true |
Other | laravel | framework | 021a892b59d42a4176cd5c0c90036c975ec547fd.json | Fix code and update change log. | tests/Pagination/PaginationPaginatorTest.php | @@ -110,13 +110,15 @@ public function testGetLinksCallsEnvironmentProperly()
public function testGetUrlProperlyFormatsUrl()
{
- $p = new Paginator($factory = m::mock('Illuminate\Pagination\Factory'), array('foo', 'bar', 'baz'), 3, 2);
- $factory->shouldReceive('getCurrentUrl')->twice()->andReturn('http://foo.co... | true |
Other | laravel | framework | ecbaf21ea4ecacf92ec46bb71a587dcb4d31d5f5.json | Tweak some formatting. | src/Illuminate/Queue/Connectors/IronConnector.php | @@ -48,7 +48,8 @@ public function connect(array $config)
$iron = new IronMQ($ironConfig);
- if (isset($config['ssl_verifypeer'])) {
+ if (isset($config['ssl_verifypeer']))
+ {
$iron->ssl_verifypeer = $config['ssl_verifypeer'];
}
| false |
Other | laravel | framework | cc7bef5b85b8192776bbaab79e955f27045acd5c.json | Fix some comments. | src/Illuminate/Database/Connectors/SQLiteConnector.php | @@ -24,7 +24,7 @@ public function connect(array $config)
$path = realpath($config['database']);
- // Here we'll verify that the SQLite database exists before we going further
+ // Here we'll verify that the SQLite database exists before going any further
// as the developer probably wants to know if the dat... | true |
Other | laravel | framework | cc7bef5b85b8192776bbaab79e955f27045acd5c.json | Fix some comments. | src/Illuminate/Database/Eloquent/Model.php | @@ -745,7 +745,7 @@ public function morphTo($name = null, $type = null, $id = null)
);
}
- // If we are not eager loading the relationship, we will essentially treat this
+ // If we are not eager loading the relationship we will essentially treat this
// as a belongs-to style relationship since morph-to e... | true |
Other | laravel | framework | cc7bef5b85b8192776bbaab79e955f27045acd5c.json | Fix some comments. | src/Illuminate/Database/Migrations/Migrator.php | @@ -72,7 +72,7 @@ public function run($path, $pretend = false)
// Once we grab all of the migration files for the path, we will compare them
// against the migrations that have already been run for this package then
- // run all of the outstanding migrations against the database connection.
+ // run each of t... | true |
Other | laravel | framework | cc7bef5b85b8192776bbaab79e955f27045acd5c.json | Fix some comments. | src/Illuminate/Routing/UrlGenerator.php | @@ -297,7 +297,7 @@ protected function getRouteQueryString(array $parameters)
// Lastly, if there are still parameters remaining, we will fetch the numeric
// parameters that are in the array and add them to the query string or we
- // will build the initial query string if it wasn't started with strings.
... | true |
Other | laravel | framework | cc7bef5b85b8192776bbaab79e955f27045acd5c.json | Fix some comments. | src/Illuminate/View/View.php | @@ -79,7 +79,7 @@ public function render(Closure $callback = null)
// Once we have the contents of the view, we will flush the sections if we are
// done rendering all views so that there is nothing left hanging over when
- // another view is rendered in the future by the application developers.
+ // another ... | true |
Other | laravel | framework | 3b30883aa8ac37e563cbe77e07d490fa36e3c9cb.json | Add security to encryption's composer file. | src/Illuminate/Encryption/composer.json | @@ -9,7 +9,8 @@
],
"require": {
"php": ">=5.3.0",
- "illuminate/support": "4.1.*"
+ "illuminate/support": "4.1.*",
+ "symfony/security": "2.4.*"
},
"require-dev": {
"phpunit/phpunit": "4.0.*" | false |
Other | laravel | framework | 7cd45b6e76c7dcdbe826693bb4c03a6771026132.json | Fix invalid composer file. | composer.json | @@ -21,7 +21,6 @@
"patchwork/utf8": "1.1.*",
"phpseclib/phpseclib": "0.3.*",
"predis/predis": "0.8.*",
-<<<<<<< HEAD
"stack/builder": "~1.0",
"swiftmailer/swiftmailer": "~5.1",
"symfony/browser-kit": "2.5.*",
| false |
Other | laravel | framework | c3e6e84229f790077b9a2b43976d326f6ef12b24.json | Improve valid MAC detection
Implement constant time string comparison as well as double HMAC
verification for encryption MACs. | composer.json | @@ -33,6 +33,7 @@
"symfony/http-kernel": "2.4.*",
"symfony/process": "2.4.*",
"symfony/routing": "2.4.*",
+ "symfony/security": "2.4.*",
"symfony/translation": "2.4.*"
},
"replace": {
| true |
Other | laravel | framework | c3e6e84229f790077b9a2b43976d326f6ef12b24.json | Improve valid MAC detection
Implement constant time string comparison as well as double HMAC
verification for encryption MACs. | src/Illuminate/Encryption/Encrypter.php | @@ -1,5 +1,8 @@
<?php namespace Illuminate\Encryption;
+use Symfony\Component\Security\Core\Util\StringUtils;
+use Symfony\Component\Security\Core\Util\SecureRandom;
+
class DecryptException extends \RuntimeException {}
class Encrypter {
@@ -145,7 +148,11 @@ protected function getJsonPayload($payload)
*/
pr... | true |
Other | laravel | framework | c31543cdbdff9d8731b635a271f367b04c172fb4.json | Fix a typo error
The correct word is "Decrement". | src/Illuminate/Cache/DatabaseStore.php | @@ -132,7 +132,7 @@ public function increment($key, $value = 1)
*/
public function decrement($key, $value = 1)
{
- throw new \LogicException("Increment operations not supported by this driver.");
+ throw new \LogicException("Decrement operations not supported by this driver.");
}
/** | false |
Other | laravel | framework | 7435635e501140d9addf2eabd5524a5d027e5b98.json | Replace spaces with tabs | src/Illuminate/Console/Command.php | @@ -268,7 +268,7 @@ public function table(array $headers, array $rows, $style = 'default')
$table = new Table($this->output);
$table->setHeaders($headers);
$table->setRows($rows);
- $table->setStyle($style);
+ $table->setStyle($style);
$table->render();
}
| false |
Other | laravel | framework | b55b0e6ab5d7c9a3c9c369705838e022c1b39874.json | Replace deprecated Table helper | src/Illuminate/Console/Command.php | @@ -1,5 +1,6 @@
<?php namespace Illuminate\Console;
+use Symfony\Component\Helper\Table;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Question\Question;
@@ -254,19 +255,21 @@ public function choice($question, array $choices, $defaul... | false |
Other | laravel | framework | b08866c08e69e0812cb4d863f08e6b17a1fa5edf.json | Replace spaces with tabs | src/Illuminate/Console/Command.php | @@ -178,8 +178,8 @@ public function option($key = null)
*/
public function confirm($question, $default = true)
{
- $helper = $this->getHelperSet()->get('question');
- $question = new ConfirmationQuestion($question, $default);
+ $helper = $this->getHelperSet()->get('question');
+ $question = new C... | false |
Other | laravel | framework | 8e2e5fea08e26530ee3a8965de78c57329a50d6f.json | Fix loose matching when validating route schemes. | src/Illuminate/Routing/Route.php | @@ -687,7 +687,7 @@ public function methods()
*/
public function httpOnly()
{
- return in_array('http', $this->action);
+ return in_array('http', $this->action, true);
}
/**
@@ -707,7 +707,7 @@ public function httpsOnly()
*/
public function secure()
{
- return in_array('https', $this->... | true |
Other | laravel | framework | 8e2e5fea08e26530ee3a8965de78c57329a50d6f.json | Fix loose matching when validating route schemes. | tests/Routing/RoutingRouteTest.php | @@ -387,6 +387,10 @@ public function testMatchesMethodAgainstRequests()
$route = new Route('GET', 'foo/{bar}', array('https', function() {}));
$this->assertTrue($route->matches($request));
+ $request = Request::create('https://foo.com/foo/bar', 'GET');
+ $route = new Route('GET', 'foo/{bar}', array('https... | true |
Other | laravel | framework | b9586cc46d55451e24ead6adea7eeb7246a57817.json | Use Unix Socket or Host and port
Referring to this (http://us3.php.net/manual/en/ref.pdo-mysql.connection.php) document explaining that unix socket should not be used together with Host and Port. | src/Illuminate/Database/Connectors/MySqlConnector.php | @@ -55,17 +55,18 @@ protected function getDsn(array $config)
// need to establish the PDO connections and return them back for use.
extract($config);
- $dsn = "mysql:host={$host};dbname={$database}";
-
- if (isset($config['port']))
+ $dsn = "mysql:dbname={$database}";
+
+ if (isset($config['unix_socket'])... | false |
Other | laravel | framework | d8c60efe2cd5692e1b667873a85522a5b6f4101c.json | fire an event on cache clear
In some situations, users may store certain cache-style data in a more custom manner than the Cache functions permit. For example, we store most cache data in Redis, but have a few larger cacheable items (rendered, minified CSS) that would incur high levels of unnecessary network traffic f... | src/Illuminate/Cache/Console/ClearCommand.php | @@ -59,6 +59,8 @@ public function fire()
$this->cache->flush();
$this->files->delete($this->laravel['config']['app.manifest'].'/services.json');
+
+ $this->laravel['events']->fire('cache:clear');
$this->info('Application cache cleared!');
} | false |
Other | laravel | framework | 7d13619e8a6fff8a31ab984e53e87c57358294b9.json | Change method order. | src/Illuminate/Auth/UserInterface.php | @@ -16,13 +16,6 @@ public function getAuthIdentifier();
*/
public function getAuthPassword();
- /**
- * Get the column name for the "remember me" token.
- *
- * @return string
- */
- public function getRememberTokenName();
-
/**
* Get the token value for the "remember me" session.
*
@@ -38,4 +31,11 @... | false |
Other | laravel | framework | a201a02a2c8c81bcacd0fb426ff845ad85f6f361.json | Update replacerRequiredIf for multiple values
:value is being used as though it were :values. To correct this would mean updating the default language lines. | src/Illuminate/Validation/Validator.php | @@ -1709,9 +1709,9 @@ protected function replaceRequiredWithoutAll($message, $attribute, $rule, $param
*/
protected function replaceRequiredIf($message, $attribute, $rule, $parameters)
{
- $parameters[0] = $this->getAttribute($parameters[0]);
+ $other = $this->getAttribute($parameters[0]);
- return str_repl... | false |
Other | laravel | framework | 3202b1ab6bdbd32d602261d77d1de131797938b9.json | Fix sometimes validation for nested arrays | src/Illuminate/Validation/Validator.php | @@ -307,7 +307,7 @@ protected function getValue($attribute)
protected function isValidatable($rule, $attribute, $value)
{
return $this->presentOrRuleIsImplicit($rule, $attribute, $value) &&
- $this->passesOptionalCheck($attribute);
+ $this->passesOptionalCheck($attribute);
}
/**
@@ -333,7 +... | true |
Other | laravel | framework | 3202b1ab6bdbd32d602261d77d1de131797938b9.json | Fix sometimes validation for nested arrays | tests/Validation/ValidationValidatorTest.php | @@ -12,6 +12,19 @@ public function tearDown()
}
+ public function testSometimesWorksOnNestedArrays()
+ {
+ $trans = $this->getRealTranslator();
+ $v = new Validator($trans, array('foo' => array('bar' => array('baz' => ''))), array('foo.bar.baz' => 'sometimes|required'));
+ $this->assertFalse($v->passes());
+ ... | true |
Other | laravel | framework | 9b4271f7b6963da0f57ad087dce5668adafd19d3.json | Remove unnecessary check. | src/Illuminate/Database/Eloquent/Builder.php | @@ -579,7 +579,7 @@ protected function isNested($name, $relation)
{
$dots = str_contains($name, '.');
- return $dots && starts_with($name, $relation.'.') && $name != $relation;
+ return $dots && starts_with($name, $relation.'.');
}
/** | false |
Other | laravel | framework | b6888c026a543d25783cfaf5b502b91bfa95624f.json | Fix nested relations with subset names. | src/Illuminate/Database/Eloquent/Builder.php | @@ -579,7 +579,7 @@ protected function isNested($name, $relation)
{
$dots = str_contains($name, '.');
- return $dots && starts_with($name, $relation) && $name != $relation;
+ return $dots && starts_with($name, $relation.'.') && $name != $relation;
}
/** | true |
Other | laravel | framework | b6888c026a543d25783cfaf5b502b91bfa95624f.json | Fix nested relations with subset names. | tests/Database/DatabaseEloquentBuilderTest.php | @@ -318,6 +318,27 @@ public function testGetRelationProperlySetsNestedRelationships()
}
+ public function testGetRelationProperlySetsNestedRelationshipsWithSimilarNames()
+ {
+ $builder = $this->getBuilder();
+ $builder->setModel($this->getMockModel());
+ $builder->getModel()->shouldReceive('orders')->once()->... | true |
Other | laravel | framework | 0b9dd1fec3417d778aba2bcaff4436ca1fc7c754.json | move comment to appropriate location | src/Illuminate/Database/Query/Builder.php | @@ -1549,13 +1549,13 @@ protected function ungroupedPaginate($paginator, $perPage, $columns)
*/
public function getPaginationCount()
{
+ // Because some database engines may throw errors if we leave the ordering
+ // statements on the query, we will "back them up" and remove them from
+ // the query. Once we ... | false |
Other | laravel | framework | 6a1981a9ee5799cb220ac1aa7256fa3a36c0a4bd.json | add distinct pagination test | tests/Database/DatabaseQueryBuilderTest.php | @@ -690,6 +690,27 @@ public function testGetPaginationCountGetsResultCount()
}
+ public function testGetPaginationCountGetsResultCountWithSelectDistinct()
+ {
+ unset($_SERVER['orders']);
+ $builder = $this->getBuilder();
+ $builder->getConnection()->shouldReceive('select')->once()->with('select count(distinct... | false |
Other | laravel | framework | c9f84fe994e25c468cd3ef457fd638cf4fe0dd73.json | Add events firing in transaction.
Signed-off-by: Kevin Simard <kesimard@outlook.com> | src/Illuminate/Database/Connection.php | @@ -454,6 +454,11 @@ public function beginTransaction()
{
$this->pdo->beginTransaction();
}
+
+ if (isset($this->events))
+ {
+ $this->events->fire('connection.beganTransaction', $this);
+ }
}
/**
@@ -466,6 +471,11 @@ public function commit()
if ($this->transactions == 1) $this->pdo->commit();
... | true |
Other | laravel | framework | c9f84fe994e25c468cd3ef457fd638cf4fe0dd73.json | Add events firing in transaction.
Signed-off-by: Kevin Simard <kesimard@outlook.com> | tests/Database/DatabaseConnectionTest.php | @@ -121,6 +121,36 @@ public function testAffectingStatementProperlyCallsPDO()
}
+ public function testBeganTransactionFiresEventsIfSet()
+ {
+ $pdo = $this->getMock('DatabaseConnectionTestMockPDO');
+ $connection = $this->getMockConnection(array(), $pdo);
+ $connection->setEventDispatcher($events = m::mock('Il... | true |
Other | laravel | framework | 2286d156388ac57b7de8824ade3676298626aaf6.json | Support mixed target data in data_get | src/Illuminate/Support/helpers.php | @@ -557,23 +557,38 @@ function csrf_token()
* @param string $key
* @param mixed $default
* @return mixed
- *
- * @throws \InvalidArgumentException
*/
function data_get($target, $key, $default = null)
{
- if (is_array($target))
- {
- return array_get($target, $key, $default);
- }
- elseif (i... | true |
Other | laravel | framework | 2286d156388ac57b7de8824ade3676298626aaf6.json | Support mixed target data in data_get | tests/Support/SupportHelpersTest.php | @@ -207,6 +207,17 @@ public function testObjectGet()
$this->assertEquals('Taylor', object_get($class, 'name.first'));
}
+ public function testDataGet()
+ {
+ $object = (object) array('users' => array('name' => array('Taylor', 'Otwell')));
+ $array = array((object) array('users' => array((object) array('name' =... | true |
Other | laravel | framework | ff424f62a1d855c5a4b7c9a5ffa0f9a17b25c551.json | Remove unused app variables from the tests | tests/Foundation/ProviderRepositoryTest.php | @@ -93,7 +93,6 @@ public function testLoadManifestReturnsParsedJSON()
$repo = new Illuminate\Foundation\ProviderRepository($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__);
$files->shouldReceive('exists')->once()->with(__DIR__.'/services.json')->andReturn(true);
$files->shouldReceive('get')->once... | false |
Other | laravel | framework | 666241ebc6c99cd3af0c3ce7fc63d7107c6edc3b.json | Remove the count. | src/Illuminate/Database/Eloquent/Builder.php | @@ -696,8 +696,6 @@ protected function addHasWhere(Builder $hasQuery, Relation $relation, $operator,
{
$this->mergeWheresToHas($hasQuery, $relation);
- $count = new Expression((int) $count);
-
return $this->where(new Expression('('.$hasQuery->toSql().')'), $operator, $count, $boolean);
}
| false |
Other | laravel | framework | aafa11b45636841c4eb175e070450ae3a68aa544.json | Turn the count into an expression. | src/Illuminate/Database/Eloquent/Builder.php | @@ -696,6 +696,8 @@ protected function addHasWhere(Builder $hasQuery, Relation $relation, $operator,
{
$this->mergeWheresToHas($hasQuery, $relation);
+ $count = new Expression((int) $count);
+
return $this->where(new Expression('('.$hasQuery->toSql().')'), $operator, $count, $boolean);
}
| false |
Other | laravel | framework | 549faad51c4b9ca05cc4e49f354e7b55d0f3afb9.json | Throw exception when no primary key and deleting. | src/Illuminate/Database/Eloquent/Model.php | @@ -960,6 +960,11 @@ public static function destroy($ids)
*/
public function delete()
{
+ if (is_null($this->primaryKey))
+ {
+ throw new \Exception("No primary key defined on model.");
+ }
+
if ($this->exists)
{
if ($this->fireModelEvent('deleting') === false) return false; | false |
Other | laravel | framework | 657338b49c0f6b48a892ddb06eafd13baab1948a.json | Fix bug. Update change log. | src/Illuminate/Foundation/changes.json | @@ -13,7 +13,8 @@
{"message": "Soft deleting models now use SoftDeletingTrait instead of softDelete property.", "backport": null},
{"message": "The queue:listen command will now write the names of the jobs it processes to the console.", "backport": null},
{"message": "Added Mailgun API transport for Mail::send... | true |
Other | laravel | framework | 657338b49c0f6b48a892ddb06eafd13baab1948a.json | Fix bug. Update change log. | src/Illuminate/Mail/MailServiceProvider.php | @@ -222,7 +222,7 @@ protected function registerLogTransport($config)
{
$this->app->bindShared('swift.transport', function($app)
{
- return new LogTransport($app['log']);
+ return new LogTransport($app['log']->getMonolog());
});
}
| true |
Other | laravel | framework | 4ae77db16e5fc38eff86cfba86c6f4421ac0f173.json | Log transport for mail. | src/Illuminate/Mail/MailServiceProvider.php | @@ -4,6 +4,7 @@
use Illuminate\Support\ServiceProvider;
use Swift_SmtpTransport as SmtpTransport;
use Swift_MailTransport as MailTransport;
+use Illuminate\Mail\Transport\LogTransport;
use Illuminate\Mail\Transport\MailgunTransport;
use Illuminate\Mail\Transport\MandrillTransport;
use Swift_SendmailTranspor... | true |
Other | laravel | framework | 4ae77db16e5fc38eff86cfba86c6f4421ac0f173.json | Log transport for mail. | src/Illuminate/Mail/Mailer.php | @@ -5,10 +5,10 @@
use Swift_Message;
use Illuminate\Log\Writer;
use Illuminate\View\Factory;
+use Illuminate\Events\Dispatcher;
use Illuminate\Queue\QueueManager;
use Illuminate\Container\Container;
use Illuminate\Support\SerializableClosure;
-use Illuminate\Events\Dispatcher;
class Mailer {
@@ -26,6 +26,13 ... | true |
Other | laravel | framework | 4ae77db16e5fc38eff86cfba86c6f4421ac0f173.json | Log transport for mail. | src/Illuminate/Mail/Transport/LogTransport.php | @@ -0,0 +1,68 @@
+<?php namespace Illuminate\Mail\Transport;
+
+use Swift_Transport;
+use Swift_Mime_Message;
+use Psr\Log\LoggerInterface;
+use Swift_Events_EventListener;
+
+class LogTransport implements Swift_Transport {
+
+ /**
+ * The Logger instance.
+ *
+ * @var \Psr\Log\LoggerInterface
+ */
+ protected $log... | true |
Other | laravel | framework | 4ae77db16e5fc38eff86cfba86c6f4421ac0f173.json | Log transport for mail. | tests/Mail/MailMailerTest.php | @@ -139,11 +139,10 @@ public function testMessagesCanBeLoggedInsteadOfSent()
$message->shouldReceive('setFrom')->never();
$mailer->setSwiftMailer(m::mock('StdClass'));
$message->shouldReceive('getTo')->once()->andReturn(array('taylor@userscape.com' => 'Taylor'));
- $message->shouldReceive('getSubject')->once(... | true |
Other | laravel | framework | 377df4f1a76530cfe6ca2c39e3fb406a87db212a.json | Add a space. | src/Illuminate/Mail/MailServiceProvider.php | @@ -24,7 +24,7 @@ public function register()
{
$me = $this;
- $this->app->bindShared('mailer', function($app) use($me)
+ $this->app->bindShared('mailer', function($app) use ($me)
{
$me->registerSwiftMailer();
| false |
Other | laravel | framework | 4af2e0be3b92f3e1f08d5cc3d2c49e9e7c64be81.json | move swiftMailer registration into closure
Signed-off-by: Suhayb El Wardany <me@suw.me> | src/Illuminate/Mail/MailServiceProvider.php | @@ -22,10 +22,12 @@ class MailServiceProvider extends ServiceProvider {
*/
public function register()
{
- $this->registerSwiftMailer();
+ $me = $this;
- $this->app->bindShared('mailer', function($app)
+ $this->app->bindShared('mailer', function($app) use($me)
{
+ $me->registerSwiftMailer();
... | false |
Other | laravel | framework | 66cf7f89405e583efab34ffeb3e07e5095c8e579.json | Add Validator::each for validation of arrays | src/Illuminate/Validation/Validator.php | @@ -201,6 +201,34 @@ public function sometimes($attribute, $rules, $callback)
}
}
+ /**
+ * Define a set of rules that apply to each element in an array attribute.
+ *
+ * @param string $attribute
+ * @param string|array $rules
+ * @return void
+ */
+ public function each($attribute, $rules)
+ {
+ $da... | true |
Other | laravel | framework | 66cf7f89405e583efab34ffeb3e07e5095c8e579.json | Add Validator::each for validation of arrays | tests/Validation/ValidationValidatorTest.php | @@ -1056,6 +1056,42 @@ public function testExceptionThrownOnIncorrectParameterCount()
}
+ public function testValidateEach()
+ {
+ $trans = $this->getRealTranslator();
+ $data = ['foo' => [['field' => 5], ['field' => 10], ['field' => 15]]];
+
+ $v = new Validator($trans, $data, ['foo' => 'array']);
+ $v->each... | true |
Other | laravel | framework | 6c643e0cd2c988344aff8038d153ee5ea16a48f8.json | Fix posting of messages. | src/Illuminate/Mail/Transport/MailgunTransport.php | @@ -73,12 +73,12 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
{
$client = $this->getHttpClient();
- $response = $client->send($client->post($this->url, ['auth' => ['api', $this->key],
+ $client->post($this->url, ['auth' => ['api', $this->key],
'body' => [
'to' => ... | true |
Other | laravel | framework | 6c643e0cd2c988344aff8038d153ee5ea16a48f8.json | Fix posting of messages. | src/Illuminate/Mail/Transport/MandrillTransport.php | @@ -55,13 +55,13 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
{
$client = $this->getHttpClient();
- $client->send($client->post('https://mandrillapp.com/api/1.0/messages/send-raw.json', [
+ $client->post('https://mandrillapp.com/api/1.0/messages/send-raw.json', [
'body' =... | true |
Other | laravel | framework | e452a41351602363420257813798b03e63f6367e.json | Remove unneeded accessor. | src/Illuminate/Mail/Transport/MailgunTransport.php | @@ -163,25 +163,4 @@ public function setDomain($domain)
return $this->domain = $domain;
}
- /**
- * Get the path to the storage directory.
- *
- * @return string
- */
- public function getStoragePath()
- {
- return $this->storagePath ?: storage_path().'/meta';
- }
-
- /**
- * Set the storage path.
- *
- ... | false |
Other | laravel | framework | 674765a6b7a256316410950dc36b8fb8c188a090.json | Convert Mailgun and Mandrill drivers to Guzzle 4. | src/Illuminate/Mail/Transport/MailgunTransport.php | @@ -2,8 +2,8 @@
use Swift_Transport;
use Swift_Mime_Message;
+use GuzzleHttp\Post\PostFile;
use Swift_Events_EventListener;
-use Guzzle\Http\Client as HttpClient;
class MailgunTransport implements Swift_Transport {
@@ -22,25 +22,24 @@ class MailgunTransport implements Swift_Transport {
protected $domain;
... | true |
Other | laravel | framework | 674765a6b7a256316410950dc36b8fb8c188a090.json | Convert Mailgun and Mandrill drivers to Guzzle 4. | src/Illuminate/Mail/Transport/MandrillTransport.php | @@ -3,7 +3,6 @@
use Swift_Transport;
use Swift_Mime_Message;
use Swift_Events_EventListener;
-use Guzzle\Http\Client as HttpClient;
class MandrillTransport implements Swift_Transport {
@@ -54,11 +53,15 @@ public function stop()
*/
public function send(Swift_Mime_Message $message, &$failedRecipients = null)... | true |
Other | laravel | framework | 4a38f403c75208cecab46ae2f05410cf351e741a.json | Add space between lines of code. | src/Illuminate/Validation/Validator.php | @@ -563,6 +563,7 @@ protected function validateRequiredIf($attribute, $value, $parameters)
$this->requireParameterCount(2, $parameters, 'required_if');
$data = array_get($this->data, $parameters[0]);
+
$values = array_slice($parameters, 1);
if (in_array($data, $values)) | false |
Other | laravel | framework | 4bc806c6fc5759d5f7227c3aa632af82282a6fa5.json | Allow multiple parameters for required_if | src/Illuminate/Validation/Validator.php | @@ -562,7 +562,10 @@ protected function validateRequiredIf($attribute, $value, $parameters)
{
$this->requireParameterCount(2, $parameters, 'required_if');
- if ($parameters[1] == array_get($this->data, $parameters[0]))
+ $data = array_get($this->data, $parameters[0]);
+ $values = array_slice($parameters, 1);
... | true |
Other | laravel | framework | 4bc806c6fc5759d5f7227c3aa632af82282a6fa5.json | Allow multiple parameters for required_if | tests/Validation/ValidationValidatorTest.php | @@ -345,6 +345,14 @@ public function testRequiredIf()
$trans = $this->getRealTranslator();
$v = new Validator($trans, array('first' => 'taylor', 'last' => 'otwell'), array('last' => 'required_if:first,taylor'));
$this->assertTrue($v->passes());
+
+ $trans = $this->getRealTranslator();
+ $v = new Validator($t... | true |
Other | laravel | framework | fbb24e5eadbb47152645e25d5b63bbdffe023058.json | Return the index instead of the choice.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com> | src/Illuminate/Console/Command.php | @@ -222,9 +222,7 @@ public function choice($question, array $choices, $default = null, $attempts = f
{
$dialog = $this->getHelperSet()->get('dialog');
- $choice = $dialog->select($this->output, "<question>$question</question>", $choices, $default, $attempts);
-
- return $choices[$choice];
+ return $dialog->se... | false |
Other | laravel | framework | 0719bad766e625f25502b695a4dcaf3b976ddcab.json | Shorten variable name. | src/Illuminate/Support/Facades/Response.php | @@ -83,16 +83,16 @@ public static function stream($callback, $status = 200, array $headers = array()
* @param \SplFileInfo|string $file
* @param string $name
* @param array $headers
- * @param null|string $contentDisposition
+ * @param null|string $disposition
* @return \Symfony\Component\HttpF... | false |
Other | laravel | framework | f1eb309438f7d19e8a71dcecc0eced5f8b33a7c3.json | Fix typo in core alias for event dispatcher | src/Illuminate/Foundation/Application.php | @@ -1073,7 +1073,7 @@ public function registerCoreContainerAliases()
'cookie' => 'Illuminate\Cookie\CookieJar',
'encrypter' => 'Illuminate\Encryption\Encrypter',
'db' => 'Illuminate\Database\DatabaseManager',
- 'events' => 'Illuminate\Events\Dispatacher',
+ 'events' ... | false |
Other | laravel | framework | f5d9bc0a6662b40cdbecea7a7f8ff6a9819954c7.json | add test for Session\Store::regenerateToken | tests/Session/SessionStoreTest.php | @@ -246,6 +246,15 @@ public function testToken()
}
+ public function testRegenerateToken()
+ {
+ $session = $this->getSession();
+ $token = $session->getToken();
+ $session->regenerateToken();
+ $this->assertNotEquals($token, $session->getToken());
+ }
+
+
public function testName()
{
$session = $this-... | false |
Other | laravel | framework | 0e4cfdc69bf8df348187f42e7c2c36a23a6cc03f.json | add findOrNew eloquent method | src/Illuminate/Database/Eloquent/Model.php | @@ -520,6 +520,20 @@ public static function find($id, $columns = array('*'))
return $instance->newQuery()->find($id, $columns);
}
+ /**
+ * Find a model by its primary key or return new static.
+ *
+ * @param mixed $id
+ * @param array $columns
+ * @return \Illuminate\Database\Eloquent\Model|Collection|... | false |
Other | laravel | framework | 6cd389a68d7fffa94fd3439ee49065562fe74ef9.json | Add a chunk method to Collection | src/Illuminate/Support/Collection.php | @@ -386,6 +386,25 @@ public function slice($offset, $length = null, $preserveKeys = false)
return new static(array_slice($this->items, $offset, $length, $preserveKeys));
}
+ /**
+ * Chunk the underlying collection array.
+ *
+ * @param int $size
+ * @param bool $preserveKeys
+ * @return \Illumina... | true |
Other | laravel | framework | 6cd389a68d7fffa94fd3439ee49065562fe74ef9.json | Add a chunk method to Collection | tests/Support/SupportCollectionTest.php | @@ -230,6 +230,19 @@ public function testReverse()
}
+ public function testChunk ()
+ {
+ $data = new Collection(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+ $data = $data->chunk(3);
+
+ $this->assertInstanceOf('Illuminate\Support\Collection', $data);
+ $this->assertInstanceOf('Illuminate\Support\Collect... | true |
Other | laravel | framework | 2704bace3a7187205db03d55f6e8304743eb8396.json | Fix bug and add regression test | src/Illuminate/Http/JsonResponse.php | @@ -5,13 +5,6 @@
class JsonResponse extends \Symfony\Component\HttpFoundation\JsonResponse {
- /**
- * The json encoding options.
- *
- * @var int
- */
- protected $jsonOptions;
-
/**
* Constructor.
*
@@ -32,14 +25,11 @@ public function __construct($data = null, $status = 200, $headers = array(), $op
... | true |
Other | laravel | framework | 2704bace3a7187205db03d55f6e8304743eb8396.json | Fix bug and add regression test | tests/Http/HttpJsonResponseTest.php | @@ -0,0 +1,13 @@
+<?php
+
+class HttpJsonResponseTest extends PHPUnit_Framework_TestCase {
+
+ public function testSetAndRetrieveData()
+ {
+ $response = new Illuminate\Http\JsonResponse(array('foo' => 'bar'));
+ $data = $response->getData();
+ $this->assertInstanceOf('StdClass', $data);
+ $this->assertEquals('bar'... | true |
Other | laravel | framework | 9997b7ffb5a9b09914db2eca12118f84a70da24f.json | Create a composite index for morphing columns | src/Illuminate/Database/Schema/Blueprint.php | @@ -668,6 +668,8 @@ public function morphs($name)
$this->unsignedInteger("{$name}_id");
$this->string("{$name}_type");
+
+ $this->index(array("{$name}_id", "{$name}_type"));
}
/** | false |
Other | laravel | framework | 077a9ef83057e8df5993ef16f1d607640cbb1dc8.json | Check path in method hasFile.
This pull-request solves a problem encountered when uploading a "corrupt" file like one of the files you can found at http://www.thinkbroadband.com/download.html.
Any of these files is considered empty in the validation (I am checking that a image is uploaded), therefore these pass val... | src/Illuminate/Http/Request.php | @@ -293,7 +293,7 @@ public function hasFile($key)
{
if (is_array($file = $this->file($key))) $file = head($file);
- return $file instanceof \SplFileInfo;
+ return $file instanceof \SplFileInfo && $file->getPath() != '';
}
/** | false |
Other | laravel | framework | 7e5514db12e390bc8acf12f8ddee9da8f480c931.json | Add default to array_pull to match array_get. | src/Illuminate/Support/helpers.php | @@ -376,11 +376,12 @@ function array_pluck($array, $value, $key = null)
*
* @param array $array
* @param string $key
+ * @param mixed $default
* @return mixed
*/
- function array_pull(&$array, $key)
+ function array_pull(&$array, $key, $default = null)
{
- $value = array_get($array, $key);
+ ... | false |
Other | laravel | framework | 58d103c921151fd9e3af626dd243beb0d5d8d460.json | add new blade statements: stack and push | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -473,6 +473,39 @@ protected function compileInclude($expression)
return "<?php echo \$__env->make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>";
}
+ /**
+ * Compile the stack statements into the content
+ *
+ * @param string $expression
+ * @return string
+ */
... | true |
Other | laravel | framework | 58d103c921151fd9e3af626dd243beb0d5d8d460.json | add new blade statements: stack and push | src/Illuminate/View/Factory.php | @@ -78,13 +78,27 @@ class Factory {
*/
protected $sectionStack = array();
+ /**
+ * The stack of in-progress stacks.
+ *
+ * @var array
+ */
+ protected $stackStack = array();
+
/**
* The number of active rendering operations.
*
* @var int
*/
protected $renderCount = 0;
+ /**
+ * All of th... | true |
Other | laravel | framework | 58d103c921151fd9e3af626dd243beb0d5d8d460.json | add new blade statements: stack and push | tests/View/ViewBladeCompilerTest.php | @@ -152,6 +152,25 @@ public function testExtendsAreCompiled()
$this->assertEquals($expected, $compiler->compileString($string));
}
+ public function testPushIsCompiled()
+ {
+ $compiler = new BladeCompiler($this->getFiles(), __DIR__);
+ $string = '@push(\'foo\')
+test
+@endpush';
+ $expected = '<?php echo $__... | true |
Other | laravel | framework | 58d103c921151fd9e3af626dd243beb0d5d8d460.json | add new blade statements: stack and push | tests/View/ViewFactoryTest.php | @@ -256,6 +256,26 @@ public function testSectionExtending()
$this->assertEquals('hi there', $factory->yieldContent('foo'));
}
+ public function testSingleStackPush()
+ {
+ $factory = $this->getFactory();
+ $factory->startPush('foo');
+ echo 'hi';
+ $factory->endPush();
+ $this->assertEquals('hi', $factory->... | true |
Other | laravel | framework | 9a2d5c67468be927b0e7530b1a5768a03b32c757.json | Handle non-string messages in Log::method() calls
Passing a more complex variable like an object or array to one of the Log calls spits out an error exception. This patch converts these messages into a `print_r` representation. | src/Illuminate/Log/Writer.php | @@ -234,6 +234,10 @@ public function write()
*/
public function __call($method, $parameters)
{
+ if (isset($parameters[0]) && in_array(gettype($parameters[0]), ['object', 'array', 'resource'])) {
+ $parameters[0] = print_r($parameters[0], true);
+ }
+
if (in_array($method, $this->levels))
{
call_... | false |
Other | laravel | framework | e4401ea20b687675178db34738a93bffd628919e.json | add getPath() method to BladeCompiler | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -11,6 +11,13 @@ class BladeCompiler extends Compiler implements CompilerInterface {
*/
protected $extensions = array();
+ /**
+ * The file being compiled.
+ *
+ * @var string
+ */
+ protected $path;
+
/**
* All of the available compiler functions.
*
@@ -57,16 +64,42 @@ class BladeCompiler extends... | true |
Other | laravel | framework | e4401ea20b687675178db34738a93bffd628919e.json | add getPath() method to BladeCompiler | tests/View/ViewBladeCompilerTest.php | @@ -53,6 +53,24 @@ public function testCompileCompilesFileAndReturnsContents()
}
+ public function testCompileCompilesAndGetThePath()
+ {
+ $compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);
+ $files->shouldReceive('get')->once()->with('foo')->andReturn('Hello World');
+ $files->shouldReceive(... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.