Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Handle case of client closing conn before worker replies
<?php require 'vendor/autoload.php'; $loop = new React\EventLoop\StreamSelectLoop(); $socket = new React\Socket\Server($loop); $http = new React\Http\Server($socket); $context = new React\ZMQ\Context($loop); $dealer = $context->getSocket(ZMQ::SOCKET_DEALER); $dealer->bind('tcp://127.0.0.1:4444'); $conns = new Array...
<?php require 'vendor/autoload.php'; $loop = new React\EventLoop\StreamSelectLoop(); $socket = new React\Socket\Server($loop); $http = new React\Http\Server($socket); $context = new React\ZMQ\Context($loop); $dealer = $context->getSocket(ZMQ::SOCKET_DEALER); $dealer->bind('tcp://127.0.0.1:4444'); $conns = new Array...
Add new line according to PSR-2
<?php namespace FactoryMethod; interface BookFactoryInterface { /** * @return BookFactoryInterface */ public function createBook(); }
<?php namespace FactoryMethod; interface BookFactoryInterface { /** * @return BookFactoryInterface */ public function createBook(); }
Create relationship for users table
<?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'first_name', ...
<?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'first_name', ...
Use data-bgset instead of data-bg.
<?php // [1] Regular background image; resized thumb (thumbs.dev.width) ?> <?php if($lazyload == false && c::get('resrc') == false): ?> style="background-image:url(<?php echo $thumburl; ?>);"<?php if($class): echo ' class="' . $class . '"'; endif; ?> <?php endif; ?> <?php // [2] Lazyload image; resized thumb (thumbs....
<?php // [1] Regular background image; resized thumb (thumbs.dev.width) ?> <?php if($lazyload == false && c::get('resrc') == false): ?> style="background-image:url(<?php echo $thumburl; ?>);"<?php if($class): echo ' class="' . $class . '"'; endif; ?> <?php endif; ?> <?php // [2] Lazyload image; resized thumb (thumbs....
Allow for a ZMQ socket to handle receiving for RPC.
<?php namespace Prooph\ServiceBus\Message\ZeroMQ; use ZMQSocket; class ZeroMQSocket { /** @var \ZMQSocket */ private $socket; /** @var string */ private $dsn; /** @var bool */ private $connected = false; /** * @param \ZMQSocket $socket * @param string $dsn */ public ...
<?php namespace Prooph\ServiceBus\Message\ZeroMQ; use ZMQSocket; class ZeroMQSocket { /** @var \ZMQSocket */ private $socket; /** @var string */ private $dsn; /** @var bool */ private $connected = false; /** * @param \ZMQSocket $socket * @param string $dsn */ public ...
Return an empty Media object from postMedia for early integration
<?php namespace Keyteq\Keymedia; use Keyteq\Keymedia\API\Configuration; use Keyteq\Keymedia\Model\Mapper\MapperFactory; use Keyteq\Keymedia\Util\RequestBuilder; class KeymediaClient { protected $api; public function __construct($apiUser, $apiKey, $apiUrl) { $options = compact('apiUser', 'apiKey'...
<?php namespace Keyteq\Keymedia; use Keyteq\Keymedia\API\Configuration; use Keyteq\Keymedia\Model\Mapper\MapperFactory; use Keyteq\Keymedia\Util\RequestBuilder; class KeymediaClient { protected $api; public function __construct($apiUser, $apiKey, $apiUrl) { $options = compact('apiUser', 'apiKey'...
Define arquivo principal de execução do sistema
<?php /** * Carrega o sistema * * Responsável por carregar os outros arquivos do sistema e inicializar as * propriedades necessárias * * PHP 5 * * Alf CMS * Copyright 2013-2013, Tonight Systems, Inc. (https://github.com/tonightsystems) * * Licensed under The MIT License * Redistributions of files must retain the above ...
<?php /** * Carrega o sistema * * Responsável por carregar os outros arquivos do sistema e inicializar as * propriedades necessárias * * PHP 5 * * Alf CMS * Copyright 2013-2013, Tonight Systems, Inc. (https://github.com/tonightsystems) * * Licensed under The MIT License * Redistributions of files must retain the above ...
Rename Page's title to name in the Form entity
<?php namespace Kunstmaan\NodeBundle\Form; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\AbstractType; /** * PageAdminType */ class PageAdminType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public f...
<?php namespace Kunstmaan\NodeBundle\Form; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\AbstractType; /** * PageAdminType */ class PageAdminType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public f...
Handle response status and headers in default adapter
<?php namespace Hochstrasser\Wirecard; use Psr\Http\Message\RequestInterface; use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7; abstract class Adapter { static function defaultAdapter() { return function (RequestInterface $request) { $headers = []; foreach ($request->getHead...
<?php namespace Hochstrasser\Wirecard; use Psr\Http\Message\RequestInterface; use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7; abstract class Adapter { static function defaultAdapter() { return function (RequestInterface $request) { $headers = []; foreach ($request->getHead...
Comment the msisdn query data
<?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class SMSInboundController extends Controller { public function indexAction(Request $request = NULL)...
<?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class SMSInboundController extends Controller { public function indexAction(Request $request = NULL)...
Update placeholder in translation string.
<?php namespace Crud\Error\Exception; use Cake\Error\Exception; use Cake\ORM\Entity; use Cake\Utility\Hash; /** * Exception containing validation errors from the model. Useful for API * responses where you need an error code in response * */ class ValidationException extends Exception { /** * List of validation...
<?php namespace Crud\Error\Exception; use Cake\Error\Exception; use Cake\ORM\Entity; use Cake\Utility\Hash; /** * Exception containing validation errors from the model. Useful for API * responses where you need an error code in response * */ class ValidationException extends Exception { /** * List of validation...
Split validation checks for more precise error output
<?php namespace Archibald; use Archibald\Request; class Api { private $slashToken = SLASHCOMMAND_TOKEN; private $commandName = '/archie'; public function __construct($request) { if ($request['token'] && $request['command']) { $token = $request['token']; $command = $request['command']; if ($t...
<?php namespace Archibald; use Archibald\Request; class Api { private $slashToken = SLASHCOMMAND_TOKEN; private $commandName = '/archie'; public function __construct($request) { if ($request['token'] && $request['command']) { $token = $request['token']; $command = $request['command']; if ($t...
Make loader use the url service
<?php namespace Simox; class Loader { private $registered_directories; public function __construct() { $this->registered_directories = array(); } public function registerDirs( $dirs ) { foreach( $dirs as $dir ) { $this->registered_di...
<?php namespace Simox; class Loader extends SimoxServiceBase { /** * The autoloader will search the registered directories */ private $registered_directories; public function __construct() { $this->registered_directories = array(); } /** * Direct...
Add docblock return types for node iterator class
<?php namespace Kunstmaan\NodeBundle\Entity; use Doctrine\Common\Collections\Collection; class NodeIterator implements \RecursiveIterator { private $_data; public function __construct(Collection $data) { $this->_data = $data; } /** * @return bool */ #[\ReturnTypeWillChange...
<?php namespace Kunstmaan\NodeBundle\Entity; use Doctrine\Common\Collections\Collection; class NodeIterator implements \RecursiveIterator { private $_data; public function __construct(Collection $data) { $this->_data = $data; } /** * @return bool */ #[\ReturnTypeWillChange...
Update index for sensitive fields.
<table id="user-table" class="table"> <thead> <tr class="row table-header"> <th class="table-cell">User</th> <th class="table-cell">Email</th> <th class="table-cell">Phone</th> </tr> </thead> <tbody> @forelse($users as $user) <tr class="table-row"> <td class="table-cell"><a href="{{ route('user...
<table id="user-table" class="table"> <thead> <tr class="row table-header"> <th class="table-cell">Name</th> <th class="table-cell">Contact Methods</th> <th class="table-cell">Last Visited</th> </tr> </thead> <tbody> @forelse($users as $user) ...
Add static and default routes
<?php // Load composer dependencies require 'vendor/autoload.php'; require 'src/coffee.php'; // Settings $settings = require 'config.php'; // Create a new app $app = new \Slim\App($settings); // Get container $container = $app->getContainer(); // Register component on container $container['view'] = function ($cont...
<?php // Load composer dependencies require 'vendor/autoload.php'; require 'src/coffee.php'; // Settings $settings = require 'config.php'; // Create a new app $app = new \Slim\App($settings); // Get container $container = $app->getContainer(); // Register component on container $container['view'] = function ($cont...
Check if post exists before applying foriiegn key constraint
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; return [ 'up' => function (Builder $schema) { $schema->table('fof_upload_downloads', function (Blueprint $table) { $table->foreign('post_id') ->references('id') ->on('posts')...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; return [ 'up' => function (Builder $schema) { // Set post_id null if the post does not exist. // Will prevent issues when applying foriegn key constraint. $connection = $schema->getConnection(); ...
Remove extraneous colon from url(...) regex
<?php namespace Kibo\Phast\Filters\HTML; use Kibo\Phast\ValueObjects\URL; class CSSImagesOptimizationServiceHTMLFilter extends ImagesOptimizationServiceHTMLFilter { public function transformHTMLDOM(\DOMDocument $document) { $styleTags = $document->getElementsByTagName('style'); /** @var \DOMElem...
<?php namespace Kibo\Phast\Filters\HTML; use Kibo\Phast\ValueObjects\URL; class CSSImagesOptimizationServiceHTMLFilter extends ImagesOptimizationServiceHTMLFilter { public function transformHTMLDOM(\DOMDocument $document) { $styleTags = $document->getElementsByTagName('style'); /** @var \DOMElem...
Replace the echo with return
<?php namespace Pocs\View; class ViewHelper { /** * @param $bytes * @return string */ public function sizeForHumans($bytes) { if ($bytes > 1048576) { return sprintf('%.2f MB', $bytes / 1048576); } else { if ($bytes > 1024) { return spr...
<?php namespace Pocs\View; class ViewHelper { /** * @param $bytes * @return string */ public function sizeForHumans($bytes) { if ($bytes > 1048576) { return sprintf('%.2f MB', $bytes / 1048576); } else { if ($bytes > 1024) { return spr...
Use array for search columns
<?php namespace WP_CLI\Fetchers; use WP_User; /** * Fetch a WordPress user based on one of its attributes. */ class User extends Base { /** * The message to display when an item is not found. * * @var string */ protected $msg = "Invalid user ID, email or login: '%s'"; /** * Get a user object by one ...
<?php namespace WP_CLI\Fetchers; use WP_User; /** * Fetch a WordPress user based on one of its attributes. */ class User extends Base { /** * The message to display when an item is not found. * * @var string */ protected $msg = "Invalid user ID, email or login: '%s'"; /** * Get a user object by one ...
Use verbose array syntax for PHP 5.3
<?php namespace Stripe; class BankAccountTest extends TestCase { public function testVerify() { self::authorizeFromEnv(); $customer = self::createTestCustomer(); $bankAccount = $customer->sources->create([ 'source' => [ 'object' => 'bank_account', ...
<?php namespace Stripe; class BankAccountTest extends TestCase { public function testVerify() { self::authorizeFromEnv(); $customer = self::createTestCustomer(); $bankAccount = $customer->sources->create(array( 'source' => array( 'object' => 'bank_account'...
Set up the instance of SLIR as a property of the object so it can be used by test cases if we want to.
<?php require_once 'core/slir.class.php'; abstract class SLIRTestCase extends PHPUnit_Framework_TestCase { protected function setUp() { $slir = new SLIR(); $slir->getConfig(); SLIRConfig::$defaultImagePath = null; SLIRConfig::$forceQueryString = false; // Try to fix documentRoot for CLI SL...
<?php require_once 'core/slir.class.php'; abstract class SLIRTestCase extends PHPUnit_Framework_TestCase { /** * @var SLIR */ protected $slir; /** * @return void */ protected function setUp() { $this->slir = new SLIR(); $this->slir->getConfig(); SLIRConfig::$defaultImagePath = null; ...
Move nullable type to a separate property
<?php namespace Neos\Flow\Tests\Functional\Reflection\Fixtures\Model; /* * This file is part of the Neos.Flow package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distribu...
<?php namespace Neos\Flow\Tests\Functional\Reflection\Fixtures\Model; /* * This file is part of the Neos.Flow package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distribu...
Fix compatibility with SecurityBundle 5.2
<?php /* * This file is part of the SymfonyConnect package. * * (c) Symfony <support@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SymfonyCorp\Connect\DependencyInjection\Security\Factory; use Symfony\Bu...
<?php /* * This file is part of the SymfonyConnect package. * * (c) Symfony <support@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SymfonyCorp\Connect\DependencyInjection\Security\Factory; use Symfony\Bu...
Fix a bug with menu inheritance
<?php declare(strict_types=1); namespace LAG\AdminBundle\Event\Listener\Menu; use LAG\AdminBundle\Admin\Helper\AdminHelperInterface; use LAG\AdminBundle\Event\Events\Configuration\MenuConfigurationEvent; class MenuConfigurationListener { private array $menusConfiguration; private AdminHelperInterface $helpe...
<?php declare(strict_types=1); namespace LAG\AdminBundle\Event\Listener\Menu; use LAG\AdminBundle\Admin\Helper\AdminHelperInterface; use LAG\AdminBundle\Event\Events\Configuration\MenuConfigurationEvent; class MenuConfigurationListener { private array $menusConfiguration; private AdminHelperInterface $helpe...
Remove fixme, problem is solved already
<?php // FIXME: this should start a secure session if forcessl is enabled // see lib/base.php for an example //session_start(); $_SESSION['timezone'] = $_GET['time'];
<?php $_SESSION['timezone'] = $_GET['time'];
Fix broken test in PHP 5.4
<?php namespace Test; // \HttpMessage use Kambo\HttpMessage\Uri; use Kambo\HttpMessage\Factories\String\UriFactory; /** * Unit test for the UriFactory object. * * @package Test * @author Bohuslav Simek <bohuslav@simek.si> * @license MIT */ class UriFactoryTest extends \PHPUnit_Framework_TestCase { /** ...
<?php namespace Test; // \HttpMessage use Kambo\HttpMessage\Uri; use Kambo\HttpMessage\Factories\String\UriFactory; /** * Unit test for the UriFactory object. * * @package Test * @author Bohuslav Simek <bohuslav@simek.si> * @license MIT */ class UriFactoryTest extends \PHPUnit_Framework_TestCase { /** ...
Fix menu rendering that prevents website from loading
<?php /** * Created by JetBrains PhpStorm. * User: Maxim * Date: 07/07/13 * Time: 11:43 * To change this template use File | Settings | File Templates. */ namespace Maxim\Module\ApplicationBundle\Menu; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Maxim\CMSBundle\Event\MenuEvent; class Men...
<?php /** * Created by JetBrains PhpStorm. * User: Maxim * Date: 07/07/13 * Time: 11:43 * To change this template use File | Settings | File Templates. */ namespace Maxim\Module\ApplicationBundle\Menu; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Maxim\CMSBundle\Event\MenuEvent; class Men...
Reorder mysqli_connection parameters so the environment check actually works
<?hh namespace Hack\UserDocumentation\API\Examples\AsyncMysql; require __DIR__ . "/connect.inc.php"; use \Hack\UserDocumentation\API\Examples\AsyncMysql\ConnectionInfo as CI; if (!extension_loaded('mysql') || !function_exists('mysqli_connect')) { die('Skip'); } if (!mysqli_connect(CI::$host, CI::$port, CI::$user,...
<?hh namespace Hack\UserDocumentation\API\Examples\AsyncMysql; require __DIR__ . "/connect.inc.php"; use \Hack\UserDocumentation\API\Examples\AsyncMysql\ConnectionInfo as CI; if (!extension_loaded('mysql') || !function_exists('mysqli_connect')) { die('Skip'); } if (!mysqli_connect(CI::$host, CI::$user, CI::$passw...
Make ISO3 code optional for countries
<?php declare(strict_types=1); namespace BinSoul\Common\I18n; /** * Represents a country. */ interface Country { /** * Returns the ISO2 code. */ public function getIso2(): string; /** * Returns the ISO3 code. */ public function getIso3(): string; }
<?php declare(strict_types=1); namespace BinSoul\Common\I18n; /** * Represents a country. */ interface Country { /** * Returns the ISO2 code. */ public function getIso2(): string; /** * Returns the ISO3 code. */ public function getIso3(): ?string; }
Fix namespace user data grid choice type
<?php namespace ForkCMS\Modules\Backend\Domain\UserGroup\Permission; use ForkCMS\Modules\Backend\Domain\User\User; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\OptionsReso...
<?php namespace ForkCMS\Modules\Backend\Domain\User; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\OptionsResolver\OptionsResolver; final class UserDataGridChoiceType exte...
Use laravel application instance when running suitey
<?php namespace TheCrypticAce\Suitey; use Illuminate\Pipeline\Pipeline; use Illuminate\Support\Collection; use Illuminate\Contracts\Container\Container; class Suitey { /** * A list of all executable steps * * @var \Illuminate\Support\Collection */ private $steps; /** * A contain...
<?php namespace TheCrypticAce\Suitey; use Illuminate\Pipeline\Pipeline; use Illuminate\Support\Collection; use Illuminate\Contracts\Foundation\Application; class Suitey { /** * The laravel application instance * A container used to resolve dependencies * * @var \Illuminate\Contracts\Foundatio...
Add doc annotations for the magic methods
<?php namespace CultuurNet\UDB3\ReadModel\Index; use ValueObjects\Enum\Enum; class EntityType extends Enum { const EVENT = 'event'; const ORGANIZER = 'organizer'; const PLACE = 'place'; }
<?php namespace CultuurNet\UDB3\ReadModel\Index; use ValueObjects\Enum\Enum; /** * @method EntityType EVENT * @method EntityType ORGANIZER * @method EntityType PLACE */ class EntityType extends Enum { const EVENT = 'event'; const ORGANIZER = 'organizer'; const PLACE = 'place'; }
Make an attempt to identify unknown license
<?php namespace Respect\Foundation\InfoProviders; class ProjectLicense extends AbstractProvider { public function providerPackageIni() { $iniPath = realpath($this->projectFolder.'/package.ini'); if (!file_exists($iniPath)) return; $ini = parse_ini_file($iniPath, true); return $ini['package']['license']...
<?php namespace Respect\Foundation\InfoProviders; class ProjectLicense extends AbstractProvider { public function providerPackageIni() { $iniPath = realpath($this->projectFolder.'/package.ini'); if (!file_exists($iniPath)) return; $ini = parse_ini_file($iniPath, true); return $ini['package']['license']...
Remove PHP 8 only syntax
<?php declare(strict_types=1); namespace DiContainerBenchmarks\TestSuite; final class TestSuites { public static function getTestSuite(int $number): ?TestSuiteInterface { return match ($number) { 1 => new TestSuite1(), 2 => new TestSuite2(), 3 => new TestSuite3(), ...
<?php declare(strict_types=1); namespace DiContainerBenchmarks\TestSuite; final class TestSuites { public static function getTestSuite(int $number): ?TestSuiteInterface { switch ($number) { case 1: return new TestSuite1(); case 2: return new Tes...
Add check for used invites
<?php namespace mpcmf\modules\authex\controllers; use mpcmf\modules\authex\mappers\inviteMapper; use mpcmf\modules\moduleBase\controllers\controllerBase; use mpcmf\modules\moduleBase\exceptions\mapperException; use mpcmf\system\helper\io\codes; use mpcmf\system\pattern\singleton; /** * Class inviteController * * I...
<?php namespace mpcmf\modules\authex\controllers; use mpcmf\modules\authex\mappers\inviteMapper; use mpcmf\modules\moduleBase\controllers\controllerBase; use mpcmf\modules\moduleBase\exceptions\mapperException; use mpcmf\system\helper\io\codes; use mpcmf\system\pattern\singleton; /** * Class inviteController * * I...
Update Interface to Category Index page
@extends('layouts.admin') @section('content') <div class="container"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading">List of Categories</div> <div class="panel-body"> <tabl...
@extends('layouts.admin') @section('content') <div class="container"> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> List of Categories <div class="pull-right"><a href="{{ route('adm...
Fix SQL for team filter
<?php namespace App\Nova\Filters; use App\Team; use Illuminate\Http\Request; use Laravel\Nova\Filters\Filter; class UserTeam extends Filter { /** * The filter's component. * * @var string */ public $component = 'select-filter'; /** * Apply the filter to the given query. * ...
<?php namespace App\Nova\Filters; use App\Team; use Illuminate\Http\Request; use Laravel\Nova\Filters\Filter; class UserTeam extends Filter { /** * The filter's component. * * @var string */ public $component = 'select-filter'; /** * Apply the filter to the given query. * ...
Check if every param is set
<div class="backdrop_box <?php echo isset($medium_backdrop) && $medium_backdrop == 1 ? 'medium' : 'large'; ?>" id="reportissue_container"> <div class="backdrop_detail_header"> <span><?php echo __('Report an issue'); ?></span> <a href="javascript:void(0);" class="closer" onclick="TBG.Main.Helpers.Bac...
<div class="backdrop_box <?php echo isset($medium_backdrop) && $medium_backdrop == 1 ? 'medium' : 'large'; ?>" id="reportissue_container"> <div class="backdrop_detail_header"> <span><?php echo __('Report an issue'); ?></span> <a href="javascript:void(0);" class="closer" onclick="TBG.Main.Helpers.Bac...
Add fancy button on navbar
<nav class="navbar navbar-expand navbar-dark bg-dark"> <a class="navbar-brand" href="{{ route("home") }}">WDI Paste</a> <button class="navbar-toggler" aria-expanded="false" aria-controls="navbarCollapse" aria-label="Toggle navigation" type="button" data-toggle="collapse" data-target="#navbarCollapse"> <...
<nav class="navbar navbar-expand navbar-dark bg-dark"> <a class="navbar-brand" href="{{ route("home") }}">WDI Paste</a> <button class="navbar-toggler" aria-expanded="false" aria-controls="navbarCollapse" aria-label="Toggle navigation" type="button" data-toggle="collapse" data-target="#navbarCollapse"> <...
Fix for non-strict token check
<?php /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filt...
<?php /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filt...
Use raw output for alert message (so that quotes are not escaped).
</div> <!-- end forum container --> @if (isset($message)) <script type="text/javascript"> jQuery(function($) { var message = {{ json_encode($message) }}; FluxBB.alert(message); }); </script> <div class="alert alert-info hidden" id="alert-message"> <button typ...
</div> <!-- end forum container --> @if (isset($message)) <script type="text/javascript"> jQuery(function($) { var message = {!! json_encode($message) !!}; FluxBB.alert(message); }); </script> <div class="alert alert-info hidden" id="alert-message"> <button t...
Add IP address to CSP alerts.
<?php namespace Korobi\WebBundle\Controller; use Korobi\WebBundle\Util\Akio; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class SecurityController extends BaseController { /** * @var Akio */ private ...
<?php namespace Korobi\WebBundle\Controller; use Korobi\WebBundle\Util\Akio; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class SecurityController extends BaseController { /** * @var Akio */ private ...
Fix return type in sitemap object type interface
<?php namespace wcf\system\sitemap\object; use wcf\data\DatabaseObject; /** * Interface for sitemap objects. * * @author Joshua Ruesweg * @copyright 2001-2017 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> * @package WoltLabSuite\Core\System\Sitemap\O...
<?php namespace wcf\system\sitemap\object; use wcf\data\DatabaseObject; use wcf\data\DatabaseObjectList; /** * Interface for sitemap objects. * * @author Joshua Ruesweg * @copyright 2001-2017 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> * @package W...
Delete the unzipped cache file
<?php /** * Spigot Timings Parser * * Written by Aikar <aikar@aikar.co> * * @license MIT */ class Cache { private static $base = '/tmp/timings_'; public static function get($key) { $file = self::getFile($key); if (file_exists("$file.gz")) { return trim(gzdecode(file_get_contents("$file.gz"))); } else...
<?php /** * Spigot Timings Parser * * Written by Aikar <aikar@aikar.co> * * @license MIT */ class Cache { private static $base = '/tmp/timings_'; public static function get($key) { $file = self::getFile($key); if (file_exists("$file.gz")) { return trim(gzdecode(file_get_contents("$file.gz"))); } else...
Add redirection option to swiftmailer config
<?php namespace VGMdb\Component\Swiftmailer; use VGMdb\Component\Swiftmailer\EventListener\EmailSenderListener; use Silex\Application; use Silex\Provider\SwiftmailerServiceProvider as BaseSwiftmailerServiceProvider; /** * Swiftmailer Provider. * * @author Gigablah <gigablah@vgmdb.net> */ class SwiftmailerService...
<?php namespace VGMdb\Component\Swiftmailer; use VGMdb\Component\Swiftmailer\EventListener\EmailSenderListener; use Silex\Application; use Silex\Provider\SwiftmailerServiceProvider as BaseSwiftmailerServiceProvider; /** * Swiftmailer Provider. * * @author Gigablah <gigablah@vgmdb.net> */ class SwiftmailerService...
Revert addition of docblock to test asset
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ...
<?php namespace ZendTest\Code\Generator\TestAsset; class ClassWithNamespace { }
Add return type unions to private/internal/final/test methods
<?php namespace Symfony\Component\Cache\Tests\Fixtures; use Doctrine\Common\Cache\CacheProvider; class ArrayCache extends CacheProvider { private $data = []; protected function doFetch($id) { return $this->doContains($id) ? $this->data[$id][0] : false; } protected function doContains($i...
<?php namespace Symfony\Component\Cache\Tests\Fixtures; use Doctrine\Common\Cache\CacheProvider; class ArrayCache extends CacheProvider { private $data = []; protected function doFetch($id): mixed { return $this->doContains($id) ? $this->data[$id][0] : false; } protected function doCont...
Fix config path difference (W vs w)
<?php namespace Hyperized\WeFact; use Illuminate\Support\ServiceProvider; class WefactServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool $defer */ protected $defer = false; /** * Bootstrap the application services. * * @return ...
<?php namespace Hyperized\WeFact; use Illuminate\Support\ServiceProvider; class WefactServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool $defer */ protected $defer = false; /** * Bootstrap the application services. * * @return ...
Rename 'format' route to 'accept'
<?php return [ 'name_prefix' => 'aura.demo.', 'routes' => [ 'home' => [ 'path' => '/', 'values' => [ 'controller' => 'aura.demo.hello', 'action' => 'index', ], ], 'hello' => [ 'path' => '/hello', ...
<?php return [ 'name_prefix' => 'aura.demo.', 'routes' => [ 'home' => [ 'path' => '/', 'values' => [ 'controller' => 'aura.demo.hello', 'action' => 'index', ], ], 'hello' => [ 'path' => '/hello', ...
Throw exception if we are going to divide by 0
<?php /** * This file is part of the Statistical Classifier package. * * (c) Cam Spiers <camspiers@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Camspiers\StatisticalClassifier\Transform; /** * @author C...
<?php /** * This file is part of the Statistical Classifier package. * * (c) Cam Spiers <camspiers@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Camspiers\StatisticalClassifier\Transform; /** * @author C...
Add missing method to interface
<?php declare(strict_types=1); /* * This file is part of the FeatureToggle package. * * (c) Jad Bitar <jadbitar@mac.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace FeatureToggle\Feature; /** * Feature interface. ...
<?php declare(strict_types=1); /* * This file is part of the FeatureToggle package. * * (c) Jad Bitar <jadbitar@mac.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace FeatureToggle\Feature; /** * Feature interface. ...
Add page and it's method when displaying 404 response
<?php class Loader { private $instance = array(); public function page($name, $method='index') { if ($name==='') { $name = 'home'; } $page = $this->loadClass($name, 'Page'); if ($page === false || method_exis...
<?php class Loader { private $instance = array(); public function page($name, $method='index') { if ($name==='') { $name = 'home'; } $page = $this->loadClass($name, 'Page'); if ($page === false || method_exis...
Fix seeding to respect existing records
<?php use GeneaLabs\LaravelGovernor\Action; use GeneaLabs\LaravelGovernor\Entity; use GeneaLabs\LaravelGovernor\Ownership; use GeneaLabs\LaravelGovernor\Permission; use GeneaLabs\LaravelGovernor\Role; use Illuminate\Database\Seeder; class LaravelGovernorPermissionsTableSeeder extends Seeder { public function run(...
<?php use GeneaLabs\LaravelGovernor\Action; use GeneaLabs\LaravelGovernor\Entity; use GeneaLabs\LaravelGovernor\Ownership; use GeneaLabs\LaravelGovernor\Permission; use GeneaLabs\LaravelGovernor\Role; use Illuminate\Database\Seeder; class LaravelGovernorPermissionsTableSeeder extends Seeder { public function run(...
Use more precise null and type checks
<?php declare(strict_types=1); /* * (c) Christian Gripp <mail@core23.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Core23\ShariffBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Co...
<?php declare(strict_types=1); /* * (c) Christian Gripp <mail@core23.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Core23\ShariffBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Co...
Add missing save statement in update script
<?php class Kwc_List_ChildPages_Teaser_Update_20150309Legacy00002 extends Kwf_Update { public function postUpdate() { $cmps = Kwf_Component_Data_Root::getInstance() ->getComponentsByClass('Kwc_List_ChildPages_Teaser_Component', array('ignoreVisible'=>true) ...
<?php class Kwc_List_ChildPages_Teaser_Update_20150309Legacy00002 extends Kwf_Update { public function postUpdate() { $cmps = Kwf_Component_Data_Root::getInstance() ->getComponentsByClass('Kwc_List_ChildPages_Teaser_Component', array('ignoreVisible'=>true) ...
Fix path - backslashes in paths don't work on linux
<?php /* * Copyright 2015 RhubarbPHP * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
<?php /* * Copyright 2015 RhubarbPHP * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Fix links in public view
@extends('layouts.master') @section('title') {{ $collection->name }} @parent @stop @section('main-navigation') <!-- Skip --> @stop @section('content') <div class="container pt-5 mt-5"> <div class="mb-5 pb-5 text-lg text-muted"> <p> Výber diel z <a href="#TODO" class="underline">Webu <...
@extends('layouts.master') @section('title') {{ $collection->name }} @parent @stop @section('main-navigation') <!-- Skip --> @stop @section('content') <div class="container pt-5 mt-5"> <div class="mb-5 pb-5 text-lg text-muted"> <p> Výber diel z <a href="{{ config('app.url') }}" class=...
Add function for run code source
<?php class Controller{ protected $tpl; protected $path; protected $content = 'index.html'; function __construct($path) { $this->path = $path; $this->tpl = new Tpl(LAYOUT_PATH); } function index(){ } function run(){ $controller = $this->path[0]; $config = require(APP_PATH.'config.php'); for...
<?php class Controller{ protected $tpl; protected $path; protected $content = 'index.html'; function __construct($path) { $this->path = $path; $this->tpl = new Tpl(LAYOUT_PATH); } function index(){ } function run(){ $controller = $this->path[0]; if($controller == "code"){ //for the test code ...
Add general seeder to artisan
<?php use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { // $this->call(UsersTableSeeder::class); } }
<?php use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { $this->call([ UserSeeder::class, default_lookup_values::class, ]); } }
Fix file not found bug
<?php namespace Way\Generators\Commands; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; class ControllerGeneratorCommand extends Command { /** * The console command name. * * @var string */ protected $nam...
<?php namespace Way\Generators\Commands; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; class ControllerGeneratorCommand extends Command { /** * The console command name. * * @var string */ protected $nam...
Disable auto links by default
<?php namespace Fenrizbes\TypographBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { $treeBuilder = n...
<?php namespace Fenrizbes\TypographBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { $treeBuilder = n...
Sort imported properties by order_column.
<?php namespace Nonoesp\Folio\Commands; use Illuminate\Console\Command; use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\ProcessFailedException; // class ItemPropertiesImport extends Command { protected $signature = 'folio:prop:import {id} {json}'; protected $description = 'Impor...
<?php namespace Nonoesp\Folio\Commands; use Illuminate\Console\Command; use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\ProcessFailedException; class ItemPropertiesImport extends Command { protected $signature = 'folio:prop:import {id} {json}'; protected $description = 'Import it...
Change relative file path to absolute path
<?php $site = $app['controllers_factory']; $site->get('/', function() use ($twig) { $siteFinder = new \Devbox\WebUI\SiteFinder(new \Symfony\Component\Finder\Finder()); $sites = $siteFinder->find(__DIR__ . '/../../sites'); $data = array( 'sites' => $sites, ); return $twig->render('sites.tw...
<?php $site = $app['controllers_factory']; $site->get('/', function() use ($twig) { $siteFinder = new \Devbox\WebUI\SiteFinder(new \Symfony\Component\Finder\Finder()); $sites = $siteFinder->find('/var/www/sites'); $data = array( 'sites' => $sites, ); return $twig->render('sites.twig', $da...
Fix cache clearer doc block.
<?php declare(strict_types=1); /** * @author Alexander Volodin <mr-stanlik@yandex.ru> * @copyright Copyright (c) 2020, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ name...
<?php declare(strict_types=1); /** * @author Alexander Volodin <mr-stanlik@yandex.ru> * @copyright Copyright (c) 2020, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ name...
Handle non-existent translation_domain table to allow its creation
<?php namespace Argentum\TranslationBundle\Entity; use Doctrine\ORM\EntityRepository; /** * TranslationDomainRepository * * @author Vadim Borodavko <javer@argentum.ua> * @copyright Argentum IT Lab, http://argentum.ua */ class TranslationDomainRepository extends EntityRepository { /** * Returns a l...
<?php namespace Argentum\TranslationBundle\Entity; use Doctrine\DBAL\DBALException; use Doctrine\ORM\EntityRepository; /** * TranslationDomainRepository * * @author Vadim Borodavko <javer@argentum.ua> * @copyright Argentum IT Lab, http://argentum.ua */ class TranslationDomainRepository extends EntityReposi...
Reset display before each message
<?php function pole_display_price($label, $price) { $sock= socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (@socket_connect($sock, '127.0.0.1', 1888)) { socket_write($sock, sprintf("\x0d\x0a%-19.19s\x0a\x0d$%18.2f ", $label, $price)); } }
<?php function pole_display_price($label, $price) { $sock= socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (@socket_connect($sock, '127.0.0.1', 1888)) { socket_write($sock, sprintf("\x1f\x0d\x0a%-19.19s\x0a\x0d$%18.2f ", $label, $price)); } }
Update use of deprecated CssSelector class
<?php namespace PigeonWebkit; use Symfony\Component\CssSelector\CssSelector, Behat\Mink\Session; class FunctionalPigeon extends CapybaraWebkitDriver { protected $browser; public function __construct() { $this->browser = new PigeonBrowser(); parent::__construct($this->browser); $this->setSession(n...
<?php namespace PigeonWebkit; use Behat\Mink\Session; class FunctionalPigeon extends CapybaraWebkitDriver { protected $browser; public function __construct() { $this->browser = new PigeonBrowser(); parent::__construct($this->browser); $this->setSession(new Session($this)); $this->start(); } ...
Fix "Call to a member function close() on null" exception
<?php namespace VladimirYuldashev\LaravelQueueRabbitMQ; use Illuminate\Queue\QueueManager; use Illuminate\Support\ServiceProvider; use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors\RabbitMQConnector; use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors\RabbitMQConnectorSSL; class LaravelQueueRabbitM...
<?php namespace VladimirYuldashev\LaravelQueueRabbitMQ; use Illuminate\Queue\QueueManager; use Illuminate\Support\ServiceProvider; use PhpAmqpLib\Connection\AMQPStreamConnection; use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors\RabbitMQConnector; use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors\...
Include Users / Groups APIs
<?php use Illuminate\Http\Request; /* Note: All Routes in this file are automatically prepended with /api */ Route::get('/hello_world', function () { return "hello world"; })->middleware('http.basic.auth');
<?php use Illuminate\Http\Request; /* Note: All Routes in this file are automatically prepended with /api */ /* Manage Users */ Route::get('/users','UserController@index')->middleware('http.basic.auth'); Route::get('/users/{user}','UserController@show')->middleware('http.basic.auth'); Route::post('/users','UserContr...
Extend from new ComCategoriesControllerCategory controller.
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Contacts * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Category Con...
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Contacts * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Category Con...
Add navigation route model binding
<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond ...
<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond ...
Make login form template work even if form is escaped
<?php $view->extend('DoctrineUserBundle::layout') ?> <?php if ($view->session->hasFlash('doctrine_user_session_new/error')): ?> <div class="doctrine_user_session_new_error">Bad username or password, please try again.</div> <?php endif; ?> <?php echo $form->renderFormTag($view->router->generate('doctrine_user_session_...
<?php $view->extend('DoctrineUserBundle::layout') ?> <?php if ($view->session->hasFlash('doctrine_user_session_new/error')): ?> <div class="doctrine_user_session_new_error">Bad username or password, please try again.</div> <?php endif; ?> <?php echo $form->getRawValue()->renderFormTag($view->router->generate('doctrin...
Set timezone because it complains
<!-- Footer --> <footer> <div class="row"> <div class="col-lg-12"> <p>Copyright &copy; Purdue IEEE <?php echo date("Y") ?></p> </div> </div> </footer> </div> <!-- /.container --> <!-- Bootstrap Core JavaScript --> <script src="/js/boo...
<!-- Footer --> <footer> <div class="row"> <div class="col-lg-12"> <p>Copyright &copy; Purdue IEEE <?php date_default_timezone_set("UTC"); echo date("Y"); ?> </p> ...
Migrate data audit command to be executed in new message queue. Sort entities in data audit grid filter alphabetically
<?php namespace Oro\Bundle\DataAuditBundle\Datagrid; use Oro\Bundle\DataAuditBundle\Provider\AuditConfigProvider; use Oro\Bundle\DataGridBundle\Datasource\ResultRecord; use Oro\Bundle\EntityBundle\Provider\EntityClassNameProviderInterface; class EntityTypeProvider { /** @var EntityClassNameProviderInterface */ ...
<?php namespace Oro\Bundle\DataAuditBundle\Datagrid; use Oro\Bundle\DataAuditBundle\Provider\AuditConfigProvider; use Oro\Bundle\DataGridBundle\Datasource\ResultRecord; use Oro\Bundle\EntityBundle\Provider\EntityClassNameProviderInterface; class EntityTypeProvider { /** @var EntityClassNameProviderInterface */ ...
Remove ArrayInterface constraint for Method enums
<?php namespace BlizzardGalaxy\ApiSupervisor\Enum\Method; use BlizzardGalaxy\ApiSupervisor\Enum\ArrayEnumInterface; /** * Keeps a list of all the starcraft methods that can be called. * * @package BlizzardGalaxy\ApiSupervisor\Enum\Method * @author Petre Pătrașc <petre@dreamlabs.ro> */ class StarcraftApiMethod...
<?php namespace BlizzardGalaxy\ApiSupervisor\Enum\Method; /** * Keeps a list of all the starcraft methods that can be called. * * @package BlizzardGalaxy\ApiSupervisor\Enum\Method * @author Petre Pătrașc <petre@dreamlabs.ro> */ class StarcraftApiMethod { const PLAYER = 'profile'; const LADDER = 'ladder...
Add '@' prefix of setAlias('common', ...)
<?php Yii::setAlias('common', dirname(__DIR__)); Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend'); Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend'); Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
<?php Yii::setAlias('@common', dirname(__DIR__)); Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend'); Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend'); Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console');
Add defines so we don't have huge strings stored
<?php class Intent { public $action; public $direction; public function __construct( $action, $direction ) { $this->action = $action; $this->direction = $direction; } } ?>
<?php define( 'DIRECTION_NONE', 0 ); define( 'DIRECTION_NORTH', 1 ); define( 'DIRECTION_EAST', 2 ); define( 'DIRECTION_SOUTH', 3 ); define( 'DIRECTION_WEST', 4 ); define( 'ACTION_ATACK', 0 ); define( 'ACTION_MOVE', 1 ); class Intent { public $action; public $direction; ...
Fix bootbox pop on remove
</div> </div> <!-- No Element, Can be ---> <script src="<?= skin_url(); ?>scripts/jquery.cookie.js" type="text/javascript"></script> <script src="<?= skin_url(); ?>scripts/jquery.slimscroll.min.js" type="text/javascript"></script> <script src="<?= skin_url(); ?>scripts/theme.js" type="text/javascript"></script>
</div> </div> <!-- No Element, Can be ---> <script src="<?= skin_url(); ?>scripts/jquery.cookie.js" type="text/javascript"></script> <script src="<?= skin_url(); ?>scripts/jquery.slimscroll.min.js" type="text/javascript"></script> <script src="<?= skin_url(); ?>scripts/bootbox.js" type="text/javascript"></script>...
Add validation before Add To Cart
<?php namespace hipanel\actions; use hiqdev\hiart\Collection; use Yii; use yii\base\Action; class AddToCartAction extends Action { public $productClass; public $bulkLoad = false; public function run() { $data = null; $collection = new Collection([ 'model' => new $this->...
<?php namespace hipanel\actions; use hiqdev\hiart\Collection; use Yii; use yii\base\Action; class AddToCartAction extends Action { public $productClass; public $bulkLoad = false; public function run() { $data = null; $collection = new Collection([ 'model' => new $this->...
Add support for clearing reserved jobs, and delayed jobs on redis
<?php namespace Morrislaptop\LaravelQueueClear; use Illuminate\Queue\QueueManager; use Illuminate\Contracts\Queue\Factory as FactoryContract; use Morrislaptop\LaravelQueueClear\Contracts\Clearer as ClearerContract; class Clearer implements ClearerContract { /** * @var QueueManager */ protected $manager; /** ...
<?php namespace Morrislaptop\LaravelQueueClear; use Illuminate\Queue\QueueManager; use Illuminate\Contracts\Queue\Factory as FactoryContract; use Morrislaptop\LaravelQueueClear\Contracts\Clearer as ClearerContract; class Clearer implements ClearerContract { /** * @var QueueManager */ protected $mana...
Define tests for non-explicit fitment ux.
<?php /** * * * @author Sam Schmidt <samuel@dersam.net> * @since 2016-03-15 */ namespace LinusShops\Prophet\Context; trait Magento { }
<?php /** * * * @author Sam Schmidt <samuel@dersam.net> * @since 2016-03-15 */ namespace LinusShops\Prophet\Context; trait Magento { /** * @Given /^I should be able to add the product to my cart$/ */ public function assertCanAddProductToCart() { throw new \Behat\Behat\Tester\Excepti...
Revert Back to BaseTestListener class to support phpunit 5, php 5.6
<?php /* * This file is part of the XiideaEasyAuditBundle package. * * (c) Xiidea <http://www.xiidea.net> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Xiidea\EasyAuditBundle\Tests; use PHPUnit\Framework\TestListener; if (class_ex...
<?php /* * This file is part of the XiideaEasyAuditBundle package. * * (c) Xiidea <http://www.xiidea.net> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Xiidea\EasyAuditBundle\Tests; use PHPUnit\Framework\BaseTestListener; if (clas...
Add tests for the countryByName() method
<?php use Galahad\LaravelAddressing\Entity\Country; use Galahad\LaravelAddressing\LaravelAddressing; /** * Class LaravelAddressingTest * * @author Junior Grossi <juniorgro@gmail.com> */ class LaravelAddressingTest extends PHPUnit_Framework_TestCase { /** * @var LaravelAddressing */ protected $ad...
<?php use Galahad\LaravelAddressing\Entity\Country; use Galahad\LaravelAddressing\LaravelAddressing; /** * Class LaravelAddressingTest * * @author Junior Grossi <juniorgro@gmail.com> */ class LaravelAddressingTest extends PHPUnit_Framework_TestCase { /** * @var LaravelAddressing */ protected $ad...
Add configuration so the sole test passes
<?php /** * Phergie plugin for displaying data from tweets (https://github.com/phergie/phergie-irc-plugin-react-twitter) * * @link https://github.com/phergie/phergie-irc-plugin-react-twitter for the canonical source repository * @copyright Copyright (c) 2008-2014 Phergie Development Team (http://phergie.org) * @li...
<?php /** * Phergie plugin for displaying data from tweets (https://github.com/phergie/phergie-irc-plugin-react-twitter) * * @link https://github.com/phergie/phergie-irc-plugin-react-twitter for the canonical source repository * @copyright Copyright (c) 2008-2014 Phergie Development Team (http://phergie.org) * @li...
Enable strict interpretation of scalar type declarations
<?php /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner; class Exception extends \RuntimeException implements \PHPUnit\Exc...
<?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner; class Exception extends \RuntimeExceptio...
Remove setting of 'alert' property
<?php namespace TomIrons\Tuxedo\Mailables; use TomIrons\Tuxedo\Message; use TomIrons\Tuxedo\TuxedoMailable; class AlertMailable extends TuxedoMailable { use Message; /** * The view to use for the message. * * @var string */ public $view = 'tuxedo::templates.alert'; /** * Th...
<?php namespace TomIrons\Tuxedo\Mailables; use TomIrons\Tuxedo\Message; use TomIrons\Tuxedo\TuxedoMailable; class AlertMailable extends TuxedoMailable { use Message; /** * The view to use for the message. * * @var string */ public $view = 'tuxedo::templates.alert'; /** * Th...
Send event author in webhook notification
<?php namespace Kanboard\Notification; use Kanboard\Core\Base; use Kanboard\Core\Notification\NotificationInterface; /** * Webhook Notification * * @package Kanboard\Notification * @author Frederic Guillot */ class WebhookNotification extends Base implements NotificationInterface { /** * Send notifi...
<?php namespace Kanboard\Notification; use Kanboard\Core\Base; use Kanboard\Core\Notification\NotificationInterface; /** * Webhook Notification * * @package Kanboard\Notification * @author Frederic Guillot */ class WebhookNotification extends Base implements NotificationInterface { /** * Send notifi...
Load the stream wrapper at build
<?php namespace ConnectHolland\Sulu\BlockBundle; use Nijens\ProtocolStream\Stream\Stream; use Nijens\ProtocolStream\StreamManager; use Symfony\Component\HttpKernel\Bundle\Bundle; class ConnectHollandSuluBlockBundle extends Bundle { /** * {@inheritdoc} */ public function boot() { $stream...
<?php namespace ConnectHolland\Sulu\BlockBundle; use Nijens\ProtocolStream\StreamManager; use Nijens\ProtocolStream\Stream\Stream; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; class ConnectHollandSuluBlockBundle extends Bundle { /** * {@inheritd...
Fix not loggin on empty routes
<?php /** * Part of the Tracker package. * * NOTICE OF LICENSE * * Licensed under the 3-clause BSD License. * * This source file is subject to the 3-clause BSD License that is * bundled with this package in the LICENSE file. It is also available at * the following URL: http://www.opensource.org/li...
<?php /** * Part of the Tracker package. * * NOTICE OF LICENSE * * Licensed under the 3-clause BSD License. * * This source file is subject to the 3-clause BSD License that is * bundled with this package in the LICENSE file. It is also available at * the following URL: http://www.opensource.org/li...
Use settings from conf file
<?php require __DIR__ . '/src/Vlc.php'; require file_exists(__DIR__ . '/conf.php') ? __DIR__ . '/conf.php' : __DIR__ . '/default.conf.php'; $vlc = new \jcisio\Karaoke\Vlc('127.0.0.1', 8080, '1234', array('/media/hd2/Karaoke')); $items = $vlc->getFileList(); $action = isset($_GET['action']) ? $_GET['action'] : 'list';...
<?php require __DIR__ . '/src/Vlc.php'; require file_exists(__DIR__ . '/conf.php') ? __DIR__ . '/conf.php' : __DIR__ . '/default.conf.php'; $vlc = new \jcisio\Karaoke\Vlc($host, $port, $password, $paths); $items = $vlc->getFileList(); $action = isset($_GET['action']) ? $_GET['action'] : 'list'; switch ($action) { ...
Change the order of the Web_Alltests suite
<?php require_once dirname(__FILE__).'/../phpunit.php'; if(!defined('PHPUnit_MAIN_METHOD')) { define('PHPUnit_MAIN_METHOD', 'Web_AllTests::main'); } require_once 'TAssetManagerTest.php'; require_once 'THttpCookieCollectionTest.php'; require_once 'THttpCookieTest.php'; require_once 'THttpRequestTest.php'; require_on...
<?php require_once dirname(__FILE__).'/../phpunit.php'; if(!defined('PHPUnit_MAIN_METHOD')) { define('PHPUnit_MAIN_METHOD', 'Web_AllTests::main'); } require_once 'TAssetManagerTest.php'; require_once 'THttpCookieCollectionTest.php'; require_once 'THttpCookieTest.php'; require_once 'THttpRequestTest.php'; require_on...
Set callback param to false
<?php use Proud\Core; class AgencyMenu extends Core\ProudWidget { function __construct() { parent::__construct( 'agency_menu', // Base ID __( 'Agency menu', 'wp-agency' ), // Name array( 'description' => __( "Display an agency menu", 'wp-agency' ), ) // Args ); } function initialize(...
<?php use Proud\Core; class AgencyMenu extends Core\ProudWidget { function __construct() { parent::__construct( 'agency_menu', // Base ID __( 'Agency menu', 'wp-agency' ), // Name array( 'description' => __( "Display an agency menu", 'wp-agency' ), ) // Args ); } function initialize(...
Add WAMP PATH and VHOST PATH (Defaut WAMP 64 v3, mostly used)
<?php // MySQL Parameters define("MYSQL_USER", "root"); define("MYSQL_PASSWORD", ""); define("MYSQL_HOST", "localhost"); // Show Options define("SHOW_CONFIG", true); define("SHOW_PARAMETERS", true); // Main projects Directory define("WWW_DIR", "../"); // Ignored projects to not sync define("IGNORED_PRO...
<?php // MySQL Parameters define("MYSQL_USER", "root"); define("MYSQL_PASSWORD", ""); define("MYSQL_HOST", "localhost"); // Show Options define("SHOW_CONFIG", true); define("SHOW_PARAMETERS", true); // Main projects Directory define("WWW_DIR", "../"); // Ignored projects to not sync define("IGNORED_PRO...
Fix indentation and arrange imports from shortest tolongest
<?php namespace ChopBox\Http\Controllers; use ChopBox\helpers\PostChop; use ChopBox\Http\Requests\ChopsFormRequest; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Input as Input; class ChopsController extends Controller { /** * Store posted chops * * @param Request $request ...
<?php namespace ChopBox\Http\Controllers; use ChopBox\helpers\PostChop; use Illuminate\Support\Facades\Auth; use ChopBox\Http\Requests\ChopsFormRequest; use Illuminate\Support\Facades\Input as Input; class ChopsController extends Controller { /** * Store posted chops * * @param Request $request ...
Allow to have text nodes when using t:extends. They can be twig nodes
<?php namespace Goetas\Twital\Node; use Goetas\Twital\Node; use Goetas\Twital\Exception; use Goetas\Twital\Compiler; use Goetas\Twital\Helper\DOMHelper; /** * * @author Asmir Mustafic <goetas@gmail.com> * */ class ExtendsNode implements Node { public function visit(\DOMElement $node, Compiler $context) { ...
<?php namespace Goetas\Twital\Node; use Goetas\Twital\Node; use Goetas\Twital\Exception; use Goetas\Twital\Compiler; use Goetas\Twital\Helper\DOMHelper; /** * * @author Asmir Mustafic <goetas@gmail.com> * */ class ExtendsNode implements Node { public function visit(\DOMElement $node, Compiler $context) { ...
Check Loader instance identity, not equality
<?php use Illuminate\Foundation\AliasLoader; class FoundationAliasLoaderTest extends PHPUnit_Framework_TestCase { public function testLoaderCanBeCreatedAndRegisteredOnce() { $loader = AliasLoader::getInstance(['foo' => 'bar']); $this->assertEquals(['foo' => 'bar'], $loader->getAliases()); ...
<?php use Illuminate\Foundation\AliasLoader; class FoundationAliasLoaderTest extends PHPUnit_Framework_TestCase { public function testLoaderCanBeCreatedAndRegisteredOnce() { $loader = AliasLoader::getInstance(['foo' => 'bar']); $this->assertEquals(['foo' => 'bar'], $loader->getAliases()); ...
Adjust setting responsiveRefreshRate to trigger resize before elementWidthChange
<?php class Kwf_Owlcarousel_Kwc_Carousel_Component extends Kwc_Abstract_List_Component { public static function getSettings() { $ret = parent::getSettings(); $ret['componentName'] = trlKwfStatic('List Carousel'); $ret['generators']['child']['component'] = 'Kwf_Owlcarousel_Kwc_Carousel_Im...
<?php class Kwf_Owlcarousel_Kwc_Carousel_Component extends Kwc_Abstract_List_Component { public static function getSettings() { $ret = parent::getSettings(); $ret['componentName'] = trlKwfStatic('List Carousel'); $ret['generators']['child']['component'] = 'Kwf_Owlcarousel_Kwc_Carousel_Im...
Add config and changeConfig to interface
<?php namespace Performance\Lib; /** * Created by PhpStorm. * User: bvanhoekelen * Date: 13-03-17 * Time: 21:35 */ interface PerformanceInterface { /* * Set measuring point X * * @param string|null $label * @return void */ public static function point($label = null); /* ...
<?php namespace Performance\Lib; /** * Created by PhpStorm. * User: bvanhoekelen * Date: 13-03-17 * Time: 21:35 */ interface PerformanceInterface { /* * Set measuring point X * * @param string|null $label * @return void */ public static function point($label = null); /* ...
Implement draft of config validation for phpunit
<?php use Phpcq\Config\BuildConfigInterface; use Phpcq\Plugin\ConfigurationPluginInterface; return new class implements ConfigurationPluginInterface { public function getName() : string { return 'phpunit'; } public function validateConfig(array $config) : void { } public function...
<?php use Phpcq\Config\BuildConfigInterface; use Phpcq\Plugin\ConfigurationPluginInterface; return new class implements ConfigurationPluginInterface { public function getName() : string { return 'phpunit'; } private static $knownConfigKeys = [ 'custom_flags' => 'custom_flags' ]; ...