cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,85 +1,73 @@
<?php
/*
* Copyright (C) 2016 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\Templating\Events;
use ArrayAccess;
use RuntimeException;
use Symfony\Component\EventDispatcher\Event;
/**
* This event is transmitted on event chill_block.*
*
* You may access to the context as an array :
*
* This event is transmitted on event chill_block.*.
*
* You may access to the context as an array :
*
* ```
* $var = $event['context_key']
* ```
*
* The documentation for the bundle where the event is launched should give
*
* The documentation for the bundle where the event is launched should give
* you the context keys.
*
*
* The keys are read-only: if you try to update the context using array access
* (example, using `$event['context_key'] = $bar;`, an error will be thrown.
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class DelegatedBlockRenderingEvent extends Event implements \ArrayAccess
class DelegatedBlockRenderingEvent extends Event implements ArrayAccess
{
/**
*
* @var mixed[]
*/
protected $context;
/**
* The returned content of the event
* The returned content of the event.
*
* @var string
*/
protected $content = '';
/**
* @var mixed[]
*/
protected $context;
public function __construct(array $context)
{
$this->context = $context;
}
/**
* add content to the event. This content will be printed in the
* layout which launched the event
*
* layout which launched the event.
*
* @param string $text
*/
public function addContent($text)
{
$this->content .= $text;
}
/**
* the content of the event
*
* the content of the event.
*
* @return string
*/
public function getContent()
{
return $this->content;
}
public function offsetExists($offset)
{
return isset($this->context[$offset]);
@@ -92,14 +80,13 @@ class DelegatedBlockRenderingEvent extends Event implements \ArrayAccess
public function offsetSet($offset, $value)
{
throw new \RuntimeException("The event context is read-only, you are not "
. "allowed to update it.");
throw new RuntimeException('The event context is read-only, you are not '
. 'allowed to update it.');
}
public function offsetUnset($offset)
{
throw new \RuntimeException("The event context is read-only, you are not "
. "allowed to update it.");
throw new RuntimeException('The event context is read-only, you are not '
. 'allowed to update it.');
}
}