Skip to content

Commit

Permalink
Merge branch '8.x' into 9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Feb 5, 2022
2 parents 3a0f829 + 2246744 commit 171f65d
Show file tree
Hide file tree
Showing 18 changed files with 2,287 additions and 94 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Pull Requests

# Credit: https://github.com/github/docs/blob/main/.github/workflows/notify-when-maintainers-cannot-edit.yaml

on:
pull_request_target:
types:
- opened

permissions:
pull-requests: write

jobs:
uneditable:
if: github.repository == 'laravel/framework'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
with:
script: |
const query = `
query($number: Int!) {
repository(owner: "laravel", name: "framework") {
pullRequest(number: $number) {
headRepositoryOwner {
login
}
maintainerCanModify
}
}
}
`;
const pullNumber = context.issue.number;
const variables = { number: pullNumber };
try {
console.log(`Check laravel/framework#${pullNumber} for maintainer edit access ...`);
const result = await github.graphql(query, variables);
console.log(JSON.stringify(result, null, 2));
const pullRequest = result.repository.pullRequest;
if (pullRequest.headRepositoryOwner.login === 'laravel') {
console.log('PR owned by laravel');
return;
}
if (!pullRequest.maintainerCanModify) {
console.log('PR not owned by Laravel and does not have maintainer edits enabled');
await github.issues.createComment({
issue_number: pullNumber,
owner: 'laravel',
repo: 'framework',
body: "Thanks for submitting a PR!\n\nIn order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. For information on how to do this, [see the relevant GitHub documentation](https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)."
});
}
} catch(e) {
console.log(e);
}
2,013 changes: 2,013 additions & 0 deletions CHANGELOG-8.x.md

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,6 @@ public function build($concrete)
return $this->notInstantiable($concrete);
}

// if (in_array($concrete, $this->buildStack)) {
// throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}].");
// }

$this->buildStack[] = $concrete;

$constructor = $reflector->getConstructor();
Expand Down
16 changes: 16 additions & 0 deletions src/Illuminate/Database/Connectors/PostgresConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public function connect(array $config)
$this->getDsn($config), $config, $this->getOptions($config)
);

$this->configureIsolationLevel($connection, $config);

$this->configureEncoding($connection, $config);

// Next, we will check to see if a timezone has been specified in this config
Expand All @@ -52,6 +54,20 @@ public function connect(array $config)
return $connection;
}

/**
* Set the connection transaction isolation level.
*
* @param \PDO $connection
* @param array $config
* @return void
*/
protected function configureIsolationLevel($connection, array $config)
{
if (isset($config['isolation_level'])) {
$connection->prepare("set session characteristics as transaction isolation level {$config['isolation_level']}")->execute();
}
}

/**
* Set the connection character set and collation.
*
Expand Down
29 changes: 0 additions & 29 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,6 @@ class Builder implements BuilderContract
'not similar to', 'not ilike', '~~*', '!~~*',
];

/**
* All of the available bit operators.
*
* @var string[]
*/
public $bitOperators = [
'&', '|', '^', '<<', '>>', '&~',
];

/**
* Whether to use write pdo for the select.
*
Expand Down Expand Up @@ -767,10 +758,6 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
}
}

if ($this->isBitOperator($operator)) {
$type = 'Bit';
}

// Now that we are working with just a simple query we can put the elements
// in our array and add the query binding to our array of bindings that
// will be bound to each SQL statements when it is finally executed.
Expand Down Expand Up @@ -854,18 +841,6 @@ protected function invalidOperator($operator)
! in_array(strtolower($operator), $this->grammar->getOperators(), true);
}

/**
* Determine if the operator is a bit operator.
*
* @param string $operator
* @return bool
*/
protected function isBitOperator($operator)
{
return in_array(strtolower($operator), $this->bitOperators, true) ||
in_array(strtolower($operator), $this->grammar->getBitOperators(), true);
}

/**
* Add an "or where" clause to the query.
*
Expand Down Expand Up @@ -1952,10 +1927,6 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
[$value, $operator] = [$operator, '='];
}

if ($this->isBitOperator($operator)) {
$type = 'bit';
}

$this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean');

if (! $value instanceof Expression) {
Expand Down
33 changes: 0 additions & 33 deletions src/Illuminate/Database/Query/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ class Grammar extends BaseGrammar
*/
protected $operators = [];

/**
* The grammar specific bit operators.
*
* @var array
*/
protected $bitOperators = [];

/**
* The components that make up a select clause.
*
Expand Down Expand Up @@ -262,22 +255,6 @@ protected function whereBasic(Builder $query, $where)
return $this->wrap($where['column']).' '.$operator.' '.$value;
}

/**
* Compile a bit operator where clause.
*
* @param \Illuminate\Database\Query\Builder $query
* @param array $where
* @return string
*/
protected function whereBit(Builder $query, $where)
{
$value = $this->parameter($where['value']);

$operator = str_replace('?', '??', $where['operator']);

return '('.$this->wrap($where['column']).' '.$operator.' '.$value.') != 0';
}

/**
* Compile a "where in" clause.
*
Expand Down Expand Up @@ -1354,14 +1331,4 @@ public function getOperators()
{
return $this->operators;
}

/**
* Get the grammar specific bit operators.
*
* @return array
*/
public function getBitOperators()
{
return $this->bitOperators;
}
}
1 change: 1 addition & 0 deletions src/Illuminate/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ protected function startProcess($hasEnvironment)
'LARAVEL_SAIL',
'PHP_CLI_SERVER_WORKERS',
'PHP_IDE_CONFIG',
'SYSTEMROOT',
'XDEBUG_CONFIG',
'XDEBUG_MODE',
'XDEBUG_SESSION',
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Http/Client/PendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
use Illuminate\Http\Client\Events\ResponseReceived;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Conditionable;
use Illuminate\Support\Traits\Macroable;
use Psr\Http\Message\MessageInterface;
use Symfony\Component\VarDumper\VarDumper;

class PendingRequest
{
use Macroable;
use Conditionable, Macroable;

/**
* The factory instance.
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Support/Facades/Blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @method static bool check(string $name, array ...$parameters)
* @method static string compileString(string $value)
* @method static string render(string $string, array $data = [], bool $deleteCachedView = false)
* @method static string renderComponent(\Illuminate\View\Component $component)
* @method static string getPath()
* @method static string stripParentheses(string $expression)
* @method static void aliasComponent(string $path, string|null $alias = null)
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Reflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static function isParameterSubclassOf($parameter, $className)
$paramClassName = static::getParameterClassName($parameter);

return $paramClassName
&& class_exists($paramClassName)
&& (class_exists($paramClassName) || interface_exists($paramClassName))
&& (new ReflectionClass($paramClassName))->isSubclassOf($className);
}

Expand Down
30 changes: 28 additions & 2 deletions src/Illuminate/View/Compilers/BladeCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
namespace Illuminate\View\Compilers;

use Illuminate\Container\Container;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\ReflectsClosures;
Expand Down Expand Up @@ -114,7 +116,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
protected $footer = [];

/**
* Array to temporary store the raw blocks found in the template.
* Array to temporarily store the raw blocks found in the template.
*
* @var array
*/
Expand Down Expand Up @@ -306,6 +308,30 @@ public function render()
});
}

/**
* Render a component instance to HTML.
*
* @param \Illuminate\View\Component $component
* @return string
*/
public static function renderComponent(Component $component)
{
$data = $component->data();

$view = value($component->resolveView(), $data);

if ($view instanceof View) {
return $view->with($data)->render();
} elseif ($view instanceof Htmlable) {
return $view->toHtml();
} else {
return Container::getInstance()
->make(ViewFactory::class)
->make($view, $data)
->render();
}
}

/**
* Store the blocks that do not receive compilation.
*
Expand Down Expand Up @@ -399,7 +425,7 @@ protected function restoreRawContent($result)
}

/**
* Get a placeholder to temporary mark the position of raw blocks.
* Get a placeholder to temporarily mark the position of raw blocks.
*
* @param int|string $replace
* @return string
Expand Down
Loading

0 comments on commit 171f65d

Please sign in to comment.