Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add array notifier and ability to change existent notifier
<?php /* * This file is part of the pinepain/php-weak PHP extension. * * Copyright (c) 2016 Bogdan Padalko <zaq178miami@gmail.com> * * Licensed under the MIT license: http://opensource.org/licenses/MIT * * For the full copyright and license information, please view the LICENSE * file that was distributed with ...
<?php /* * This file is part of the pinepain/php-weak PHP extension. * * Copyright (c) 2016 Bogdan Padalko <zaq178miami@gmail.com> * * Licensed under the MIT license: http://opensource.org/licenses/MIT * * For the full copyright and license information, please view the LICENSE * file that was distributed with ...
Add a helper function for building translated route links so you can do something like this: linkTo("routes.route-name", array("arrays of parameters, slugs"));
<?php if ( ! function_exists('localization')) { /** * Get the Localization instance. * * @return Arcanedev\Localization\Contracts\Localization */ function localization() { return app(Arcanedev\Localization\Contracts\Localization::class); } }
<?php if ( ! function_exists('localization')) { /** * Get the Localization instance. * * @return Arcanedev\Localization\Contracts\Localization */ function localization() { return app(Arcanedev\Localization\Contracts\Localization::class); } /** * Translated route fr...
Change client login route to avoid conflicting with laravel bootstrap route
<?php $this->router->get('admin/login', [ 'as' => 'admin.login', 'uses' => 'Admin\Auth\LoginController@showLoginForm', ]); $this->router->post('admin/login', [ 'uses'=> 'Admin\Auth\LoginController@login', ]); $this->router->get('/', [ 'as' => 'client.login', 'uses' => 'Client\Auth\LoginController@showLoginF...
<?php $this->router->get('admin/login', [ 'as' => 'admin.login', 'uses' => 'Admin\Auth\LoginController@showLoginForm', ]); $this->router->post('admin/login', [ 'uses'=> 'Admin\Auth\LoginController@login', ]); $this->router->get('login', [ 'as' => 'client.login', 'uses' => 'Client\Auth\LoginController@showLo...
Fix fatal error on unauthorized page.
<?php namespace Aurora\Http\Middleware; use Closure; use Illuminate\Contracts\Auth\Guard; class CheckRole { /** * The Guard implementation. * * @var Guard */ protected $auth; /** * Create a new filter instance. * * @param Guard $auth */ public function __con...
<?php namespace Aurora\Http\Middleware; use Closure; use Illuminate\Contracts\Auth\Guard; class CheckRole { /** * The Guard implementation. * * @var Guard */ protected $auth; /** * Create a new filter instance. * * @param Guard $auth */ public function __con...
Fix wrong table preferrence for role_user
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRoleUserTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('role_user', function (Blueprint $table) { ...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRoleUserTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('role_user', function (Blueprint $table) { ...
Put auth object to static var
<?php namespace Rudolf\Modules\A_admin; use Rudolf\Abstracts\AModel, Rudolf\Auth\Auth; class AdminModel extends AModel { /** * Returns Auth object * * @return Auth */ public function getAuth() { return new Auth($this->pdo, $this->prefix); } /** * @return array */ public function getMenuItems()...
<?php namespace Rudolf\Modules\A_admin; use Rudolf\Abstracts\AModel, Rudolf\Auth\Auth; class AdminModel extends AModel { protected static $auth; /** * Returns Auth object * * @return Auth */ public function getAuth() { if(empty(self::$auth)) { self::$auth = new Auth($this->pdo, $this->prefix); ...
Remove unused rest-client-url GET param
<?php /** * Show Wordpress page template. * Embed Wordpress page in an iframe. * * @package PTTRC * @subpackage views */ // Add iframe parameter. $url = $args['url']; if ( strpos( $url, '?' ) ) { $url .= '&'; } else { $url .= '?'; } global $here; $url .= 'iframe=1&rest-client-url=' . urlencode( $here ); ?...
<?php /** * Show Wordpress page template. * Embed Wordpress page in an iframe. * * @package PTTRC * @subpackage views */ // Add iframe parameter. $url = $args['url']; if ( strpos( $url, '?' ) ) { $url .= '&'; } else { $url .= '?'; } $url .= 'iframe=1'; ?> <a href="javascript: window.history.go( -1 );" clas...
Change mass to bulk action
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Component\Resource; final class ResourceActions { publ...
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Component\Resource; final class ResourceActions { publ...
Make the failing test pass
<?php namespace fennecweb; class ProjectsTest extends \PHPUnit_Framework_TestCase { const NICKNAME = 'listingProjectsTestUser'; const USERID = 'listingProjectsTestUser'; const PROVIDER = 'listingProjectsTestUser'; public function testExecute() { //Test for error returned by user is not lo...
<?php namespace fennecweb; class ProjectsTest extends \PHPUnit_Framework_TestCase { const NICKNAME = 'listingProjectsTestUser'; const USERID = 'listingProjectsTestUser'; const PROVIDER = 'listingProjectsTestUser'; public function testExecute() { //Test for error returned by user is not lo...
Replace tenant name by tenant title in page headers
<header class="main-header fh-fixedHeader"> <!-- Logo --> <a href="#" class="logo" data-toggle="push-menu" role="button"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"><i class="fa fa-home"></i></span> <!-- logo for regular state and mobile devices --> ...
<header class="main-header fh-fixedHeader"> <!-- Logo --> <a href="#" class="logo" data-toggle="push-menu" role="button"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"><i class="fa fa-home"></i></span> <!-- logo for regular state and mobile devices --> ...
Add fake folder path generator to base unit test
<?php use Codeception\TestCase\Test; use Faker\Factory; use Illuminate\Contracts\Logging\Log; use Mockery as m; /** * Base UnitTest * * The core test-class for all unit tests * * @author Alin Eugen Deac <aedart@gmail.com> */ abstract class BaseUnitTest extends Test { /** * @var \UnitTester */ ...
<?php use Codeception\TestCase\Test; use Faker\Factory; use Illuminate\Contracts\Logging\Log; use Mockery as m; /** * Base UnitTest * * The core test-class for all unit tests * * @author Alin Eugen Deac <aedart@gmail.com> */ abstract class BaseUnitTest extends Test { /** * @var \UnitTester */ ...
Add comment to test message
<?php use Common\Exception\LoginException; class LoginExceptionTest extends \Codeception\TestCase\Test { use Codeception\Specify; public function testLoginExceptionIsThrown() { $this->specify('', function() { throw new LoginException('I am a test'); }, ['throws' => 'Common\Exc...
<?php use Common\Exception\LoginException; class LoginExceptionTest extends \Codeception\TestCase\Test { use Codeception\Specify; public function testLoginExceptionIsThrown() { $this->specify('Throw LoginException', function() { throw new LoginException('I am a test'); }, ['th...
Use success button for saving
@extends('layout.dashboard') @section('content') <div class="header"> <span class='uppercase'> <i class="fa fa-user"></i> {{ Lang::get('cachet.dashboard.user') }} </span> </div> <div class='content-wrapper'> <div class="row"> <div class="col-sm-12"> ...
@extends('layout.dashboard') @section('content') <div class="header"> <span class='uppercase'> <i class="fa fa-user"></i> {{ Lang::get('cachet.dashboard.user') }} </span> </div> <div class='content-wrapper'> <div class="row"> <div class="col-sm-12"> ...
Replace usage of Linker with LinkRenderer service
<?php use MediaWiki\MediaWikiServices; /** * A single 'item' in the Spelling Dictionary Admin Links page */ class SDItem { public $link; static function showPage( $page_title, $desc = null, $query = [] ) { $item = new SDItem(); $item->link = Linker::link( $page_title, $desc ); return $item; } static fun...
<?php use MediaWiki\MediaWikiServices; /** * A single 'item' in the Spelling Dictionary Admin Links page */ class SDItem { public $link; static function showPage( $page_title, $desc = null, $query = [] ) { $item = new SDItem(); $item->link = MediaWikiServices::getInstance() ->getLinkRenderer()->makeLink( ...
Make bot functionality publicly available
<?php namespace eHOSP\Http\Controllers\API\v1; use Illuminate\Http\Request; use Illuminate\Http\Response; use eHOSP\Http\Requests; use eHOSP\Http\Controllers\Controller; class Bot extends Controller { public function __construct() { $this->middleware('auth:api'); } public function index(Req...
<?php namespace eHOSP\Http\Controllers\API\v1; use Illuminate\Http\Request; use Illuminate\Http\Response; use eHOSP\Http\Requests; use eHOSP\Http\Controllers\Controller; class Bot extends Controller { public function __construct() { // $this->middleware('auth:api'); } public function index(...
Use Composer autoload for unit tests.
<?php /* * This file is part of Mustache.php. * * (c) 2010-2014 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require dirname(__FILE__).'/../src/Mustache/Autoloader.php'; Mustache_Autoloader::register(); require...
<?php /* * This file is part of Mustache.php. * * (c) 2010-2014 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $loader = require dirname(__FILE__).'/../vendor/autoload.php'; $loader->add('Mustache_Test', dirname(_...
Adjust test assertions to PHPUnit 8
<?php namespace Neos\Flow\Tests\Unit\Http\Helper; use GuzzleHttp\Psr7\ServerRequest; use Neos\Flow\Http\Helper\RequestInformationHelper; use Neos\Flow\Tests\UnitTestCase; /** * Tests for the RequestInformationHelper */ class RequestInformationHelperTest extends UnitTestCase { /** * @test */ public...
<?php namespace Neos\Flow\Tests\Unit\Http\Helper; use GuzzleHttp\Psr7\ServerRequest; use Neos\Flow\Http\Helper\RequestInformationHelper; use Neos\Flow\Tests\UnitTestCase; /** * Tests for the RequestInformationHelper */ class RequestInformationHelperTest extends UnitTestCase { /** * @test */ public...
Initialize shared registry with empty array
<?php /* * This file is part of the Panda Registry Package. * * (c) Ioannis Papikas <papikas.ioan@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Panda\Registry; /** * Class SharedRegistry * @package Panda...
<?php /* * This file is part of the Panda Registry Package. * * (c) Ioannis Papikas <papikas.ioan@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Panda\Registry; /** * Class SharedRegistry * @package Panda...
Add source to the construction table.
@section('title') Construction categories - Cataclysm: Dark Days Ahead @endsection <h1>Construction categories</h1> <div class="row"> <div class="col-md-3"> <ul class="nav nav-pills nav-stacked"> @foreach($categories as $category) <li class="@if($category==$id) active @endif"><a href="{{ route(Route::currentRouteNam...
@section('title') Construction categories - Cataclysm: Dark Days Ahead @endsection <h1>Construction categories</h1> <div class="row"> <div class="col-md-3"> <ul class="nav nav-pills nav-stacked"> @foreach($categories as $category) <li class="@if($category==$id) active @endif"><a href="{{ route(Route::currentRouteNam...
Move composer autoloading to en
<?php /** * Load the system Composer Autoloader. */ require_once "../vendor/autoload.php"; /** * Set up some global constants */ // Application directory $appDir = "app"; // Public directory $pubDir = "public"; // Define FCPATH constant pointing to Fron Controller (this file) define("FCPATH", dirname(__FILE__) . ...
<?php /** * Set up some global constants */ // Application directory $appDir = "app"; // Public directory $pubDir = "public"; // Define FCPATH constant pointing to Fron Controller (this file) define("FCPATH", dirname(__FILE__) . "/"); // Define APPPATH constant pointing to Application directory define("APPPATH", FCP...
Update glob() for autoload config files
<?php chdir(dirname(__DIR__)); require_once (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library') . '/Zend/Loader/AutoloaderFactory.php'; Zend\Loader\AutoloaderFactory::factory(); $appConfig = include 'config/application.config.php'; $listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_lis...
<?php chdir(dirname(__DIR__)); require_once (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library') . '/Zend/Loader/AutoloaderFactory.php'; Zend\Loader\AutoloaderFactory::factory(); $appConfig = include 'config/application.config.php'; $listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_lis...
Simplify null check with optional()
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Http\Controllers; use App\Models\Chat\Channel; use App\Models\Chat\UserChannel; use App\Models\User; use Auth; use Reques...
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Http\Controllers; use App\Models\Chat\Channel; use App\Models\Chat\UserChannel; use App\Models\User; use Auth; use Reques...
Refactor test, check if price is an integer
<?php namespace Albergrala\Crawlers; use Albertgrala\Crawlers\PcComponentesCrawler; class PcComponentesCrawlerTest extends \PHPUnit_Framework_TestCase { protected function setUp() { $url = 'http://www.pccomponentes.com/kingston_valueram_4gb_ddr3_1333mhz_pc3_10600_cl9.html'; $this->crawler = new PcComponentesC...
<?php namespace Albergrala\Crawlers; use Albertgrala\Crawlers\PcComponentesCrawler; class PcComponentesCrawlerTest extends \PHPUnit_Framework_TestCase { protected function setUp() { $url = 'http://www.pccomponentes.com/kingston_valueram_4gb_ddr3_1333mhz_pc3_10600_cl9.html'; $this->crawler = new PcComponentesC...
Use resources for technology costs
<?php namespace OGetIt\Technology; use OGetIt\Common\OGetIt_Resources; abstract class OGetIt_Technology { /** * @var integer */ private $_type; /** * @var integer */ private $METAL; /** * @var integer */ private $CRYSTAL; /** * @var integer */ private $DEUTERIUM;...
<?php namespace OGetIt\Technology; use OGetIt\Common\OGetIt_Resources; abstract class OGetIt_Technology { /** * @var integer */ private $_type; /** * @var OGetIt_Resources */ private $_resources; /** * @param integer $type * @param integer $metal * @param integer $crystal ...
Make sure properties with dashes are handled correctly
<?php namespace spec\Scato\Serializer\ObjectAccess; use PhpSpec\ObjectBehavior; use Prophecy\Argument; use stdClass; class SimpleAccessorSpec extends ObjectBehavior { function it_should_be_an_object_accessor() { $this->shouldHaveType('Scato\Serializer\Navigation\ObjectAccessorInterface'); } ...
<?php namespace spec\Scato\Serializer\ObjectAccess; use PhpSpec\ObjectBehavior; use Prophecy\Argument; use stdClass; class SimpleAccessorSpec extends ObjectBehavior { function it_should_be_an_object_accessor() { $this->shouldHaveType('Scato\Serializer\Navigation\ObjectAccessorInterface'); } ...
Add the field that are mass assignable on the tasks table
<?php namespace Begin; use Illuminate\Database\Eloquent\Model; class Task extends Model { /** * The database table used by the model. * * @var string */ protected $table = 'tasks'; }
<?php namespace Begin; use Illuminate\Database\Eloquent\Model; class Task extends Model { /** * The database table used by the model. * * @var string */ protected $table = 'tasks'; /** * The attributes that are mass assignable. * * @var array */ protected $fil...
Fix the broken Twig 'finder' function
<?php namespace allejo\stakx\Twig; use Symfony\Component\Finder\Finder; class FinderFunction { public static function get () { return new \Twig_SimpleFunction('finder', new Finder()); } }
<?php namespace allejo\stakx\Twig; use allejo\stakx\System\Filesystem; use Symfony\Component\Filesystem\Exception\FileNotFoundException; use Symfony\Component\Finder\Finder; use Twig_Environment; class FinderFunction { public function __invoke(Twig_Environment $env, $folderLocation) { $fs = new Fi...
Use PSR-0 structure for the test too
<?php namespace Test\Staq; require_once( __DIR__ . '/../../vendor/autoload.php' ); class Application_Test extends \PHPUnit_Framework_TestCase { /************************************************************************* ATTRIBUTES *************************************************************************/ pub...
<?php namespace Test\Staq; require_once( __DIR__ . '/../../../vendor/autoload.php' ); class Application_Test extends \PHPUnit_Framework_TestCase { /************************************************************************* ATTRIBUTES *************************************************************************/ ...
Add contentTypeRole to rest controller
<?php /** * Created by PhpStorm. * User: GeoMash * Date: 3/17/14 * Time: 4:13 PM */
<?php namespace application\nutsNBolts\controller\rest\contentTypeRole { use application\nutsNBolts\base\RestController; class Index extends RestController { public function init() { $this->bindPaths ( array ( '{int}' =>'getByContentId', ) ); } /* * sample request: $.getJSON(...
Make it work when situated in a subfolder
<?php /** * Initialize the application * * @author Christophe Gosiau <christophe@tigron.be> * @author Gerry Demaret <gerry@tigron.be> */ require_once '../config/global.php'; \Skeleton\Core\Web\Handler::Run();
<?php /** * Initialize the application * * @author Christophe Gosiau <christophe@tigron.be> * @author Gerry Demaret <gerry@tigron.be> * @author David Vandemaele <david@tigron.be> */ require_once dirname(__FILE__) . '/../config/global.php'; \Skeleton\Core\Web\Handler::Run();
Remove unneeded env var to set siteaccess
<?php namespace Boris\Loader\Provider; class EzPublish extends AbstractProvider { public $name = 'ezpublish'; public function assertDir($dir) { return is_file("$dir/ezpublish/bootstrap.php.cache") && is_file("$dir/ezpublish/EzPublishKernel.php"); } public function initialize(...
<?php namespace Boris\Loader\Provider; class EzPublish extends AbstractProvider { public $name = 'ezpublish'; public function assertDir($dir) { return is_file("$dir/ezpublish/bootstrap.php.cache") && is_file("$dir/ezpublish/EzPublishKernel.php"); } public function initialize(...
Fix validation messages in category
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Validator; class Category extends Model { protected $fillable = ['name']; private static $messages = [ // name messages 'name.required' => 'El nombre es requerido', 'name.alpha' => 'El nombre no puede contener números ni símbolos', 'name.ma...
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Validator; class Category extends Model { protected $fillable = ['name']; private static $messages = [ // name messages 'name.required' => 'El nombre es requerido', 'name.unique' => 'Ya existe una categoría con ese nombre', 'name.alpha' => ...
Remove headers from php-vcr request matching
<?php use filter\Filter; use VCR\VCR; $this->args()->argument('reporter', 'default', 'verbose'); VCR::configure()->setCassettePath(__DIR__.'/spec/fixtures'); VCR::turnOn(); Filter::register('exclude.namespaces', function ($chain) { }); Filter::apply($this, 'interceptor', 'exclude.namespaces');
<?php use filter\Filter; use VCR\VCR; $this->args()->argument('reporter', 'default', 'verbose'); VCR::configure() ->setCassettePath(__DIR__.'/spec/fixtures') ->enableRequestMatchers(array('method', 'url', 'query_string', 'host')); VCR::turnOn(); Filter::register('exclude.namespaces', function ($chain) { });...
Remove presenter prop from Trait.
<?php namespace App\Presenters; trait PresentableTrait { /* * The Presenter class * * @var mixed */ protected $presenter; /** * View presenter instance * * @var mixed */ protected $presenterInstance; /** * Prepare a new or cached presenter instance ...
<?php namespace App\Presenters; trait PresentableTrait { /** * View presenter instance * * @var mixed */ protected $presenterInstance; /** * Prepare a new or cached presenter instance * * @return mixed * @throws PresenterException */ public function prese...
Fix (JWT Service): Text files should end with a newline character
<?php namespace AppBundle\Service; use Doctrine\ORM\Tools\Pagination\Paginator; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Doctrine\ORM\EntityManager; /** * Class JwtService * @package AppBundle\Service */ class JwtService{ private $ts; /** * JwtService const...
<?php namespace AppBundle\Service; use Doctrine\ORM\Tools\Pagination\Paginator; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Doctrine\ORM\EntityManager; /** * Class JwtService * @package AppBundle\Service */ class JwtService{ private $ts; /** * JwtService const...
Reformat and normalize messages, include -h and --help parameters
<?php /** * Script to validate a cfdi and show all the errors found */ require_once __DIR__ . '/../vendor/autoload.php'; use CFDIReader\CFDIFactory; call_user_func(function() use($argv, $argc) { $script = array_shift($argv); if ($argc == 1) { echo "Set the file of the file to validate\n"; ...
<?php /** * Script to validate cfdi files and show all the errors found */ require_once __DIR__ . '/../vendor/autoload.php'; use CFDIReader\CFDIFactory; $script = array_shift($argv); if ($argc == 1 || in_array('-h', $argv) || in_array('--help', $argv)) { echo "Set the file of the file to validate\n"; echo ...
Fix better link style on index page
<h1>Welcome to Kwitter</h1> <p> Ut ornare lectus sit amet est placerat in egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor leo a diam sollicitudin tempor. Ut ornare lectus sit amet! </p> Link to login page: <a href="login.php">Log in page</a> Link to register page: <a href="regis...
<h1>Welcome to Kwitter</h1> <p> Ut ornare lectus sit amet est placerat in egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor leo a diam sollicitudin tempor. Ut ornare lectus sit amet! </p> <ul> <li>Link to login page: <a href="login.php">Login page</a></li> <li>Link to register page...
Add polyfill for older browsers, so Opera 12 works
<section id="loading-shadow" hidden="hidden"> <div class="loading-wrapper"> <div class="loading-content"> <h3>Updating List Item...</h3> <div class="cssload-loader"> <div class="cssload-inner cssload-one"></div> <div class="cssload-inner cssload-two"></div> <div class="cssload-inner cssload-three">...
<section id="loading-shadow" hidden="hidden"> <div class="loading-wrapper"> <div class="loading-content"> <h3>Updating List Item...</h3> <div class="cssload-loader"> <div class="cssload-inner cssload-one"></div> <div class="cssload-inner cssload-two"></div> <div class="cssload-inner cssload-three">...
Add context comment for $txt['theme_thumbnail_href']
<?php // Version: 2.1 RC2; Settings global $settings; $txt['theme_thumbnail_href'] = '%1$s/thumbnail.png'; $txt['theme_description'] = 'The default theme from Simple Machines.<br><br>Author: The Simple Machines Team'; ?>
<?php // Version: 2.1 RC2; Settings global $settings; // argument(s): images_url as saved in settings $txt['theme_thumbnail_href'] = '%1$s/thumbnail.png'; $txt['theme_description'] = 'The default theme from Simple Machines.<br><br>Author: The Simple Machines Team'; ?>
Throw exception in menu configuration class if menu with same alias already exists.
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2016, 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. */ namespace Darvin\MenuBundle\Config...
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2016, 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. */ namespace Darvin\MenuBundle\Config...
Enable strict types in entity namer interface.
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2016, 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. */ namespace Darvin\AdminBundle\Entit...
<?php declare(strict_types=1); /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2016, 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. */ namespace...
Fix tags not being mutated
<?php namespace Vend\Statsd\Datadog; use Vend\Statsd\Metric as BaseMetric; class Metric extends BaseMetric { /** * @var array<string,string> */ protected $tags = []; public function __construct($key, $value, $type, array $tags = []) { parent::__construct($key, $value, $type); ...
<?php namespace Vend\Statsd\Datadog; use Vend\Statsd\Metric as BaseMetric; class Metric extends BaseMetric { /** * @var array<string,string> */ protected $tags = []; public function __construct($key, $value, $type, array $tags = []) { parent::__construct($key, $value, $type); ...
Change slider image markup output
<?php $slides = get_field('slides', $module->ID); ?> <div class="slider"> <ul> <?php foreach ($slides as $slide) : ?> <li> <?php if ($slide['acf_fc_layout'] == 'image') : ?> <img src="<?php echo $slide['image']['url']; ?>"> <?php elseif ($slide['acf_fc_layout'] == 'vide...
<?php $slides = get_field('slides', $module->ID); ?> <div class="slider"> <ul> <?php foreach ($slides as $slide) : ?> <li> <?php if ($slide['acf_fc_layout'] == 'image') : ?> <div class="slider-image" style="background-image:url('<?php echo $slide['image']['url']; ?>');"></div> ...
Improve error message if socket isn't configured for TLS
<?php namespace Amp\Socket; use Amp\ByteStream\ClosedException; use Amp\Failure; use Amp\Promise; class ServerSocket extends Socket { /** @inheritdoc */ public function enableCrypto(): Promise { if (($resource = $this->getResource()) === null) { return new Failure(new ClosedException("The...
<?php namespace Amp\Socket; use Amp\ByteStream\ClosedException; use Amp\Failure; use Amp\Promise; class ServerSocket extends Socket { /** @inheritdoc */ public function enableCrypto(): Promise { if (($resource = $this->getResource()) === null) { return new Failure(new ClosedException("The...
Remove header, it causes response to be downloaded as file.
<?php header('Content-type: text/json'); $post = $_POST; $post['OK'] = 1; if (!empty($_FILES)) { $file_field_name = key($_FILES); if (!$_FILES[$file_field_name]['error']) { $post[$file_field_name] = $_FILES[$file_field_name]; } } echo json_encode($post);
<?php $post = $_POST; $post['OK'] = 1; if (!empty($_FILES)) { $file_field_name = key($_FILES); if (!$_FILES[$file_field_name]['error']) { $post[$file_field_name] = $_FILES[$file_field_name]; } } echo json_encode($post);
Fix parametre passé à formulaire
<?php namespace Leha\HistoriqueBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; class HistorySearchType extends AbstractType { /** * Returns the name of this type. * * @return string The name of this type */ public function getNam...
<?php namespace Leha\HistoriqueBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class HistorySearchType extends AbstractType { /** * Returns the name of this type. * * @return...
Return repository in Manager Class MongoDB
<?php namespace FOS\ElasticaBundle\Doctrine\MongoDB; use FOS\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer; /** * Maps Elastica documents with Doctrine objects * This mapper assumes an exact match between * elastica documents ids and doctrine object ids */ class ElasticaToModelTransformer extends Ab...
<?php namespace FOS\ElasticaBundle\Doctrine\MongoDB; use FOS\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer; /** * Maps Elastica documents with Doctrine objects * This mapper assumes an exact match between * elastica documents ids and doctrine object ids */ class ElasticaToModelTransformer extends Ab...
Fix an error jenkins found
<?php /** * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ class OC_L10N_String{ protected $l10n; public function __construct($l10n, $text, $parameters, $count = 1) { $this->l10n = $l10...
<?php /** * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ class OC_L10N_String{ protected $l10n; public function __construct($l10n, $text, $parameters, $count = 1) { $this->l10n = $l10...
Set default timezone for tests
<?php define("TEST_ASSETS_DIR", __DIR__ . "/assets"); require_once dirname(__DIR__) . "/vendor/autoload.php";
<?php define("TEST_ASSETS_DIR", __DIR__ . "/assets"); require_once dirname(__DIR__) . "/vendor/autoload.php"; if (empty(ini_get("date.timezone"))) { ini_set("date.timezone", "UTC"); }
FIX Backport and sanitiseClassName for the "Save" action URL
<?php /** * A custom grid field request handler that allows interacting with form fields when adding records. */ class GridFieldAddNewMultiClassHandler extends GridFieldDetailForm_ItemRequest { public function Link($action = null) { if($this->record->ID) { return parent::Link($action); } else { return Con...
<?php /** * A custom grid field request handler that allows interacting with form fields when adding records. */ class GridFieldAddNewMultiClassHandler extends GridFieldDetailForm_ItemRequest { public function Link($action = null) { if($this->record->ID) { return parent::Link($action); } else { return Con...
Improve the Cache extensions from Shared namespace
<?php namespace Shared\Cache\Jobs; use Nova\Bus\QueueableTrait; use Nova\Queue\SerializesModelsTrait; use Nova\Queue\InteractsWithQueueTrait; use Nova\Queue\ShouldQueueInterface; use Nova\Support\Facades\Cache; class FlushTagFromFileCache implements ShouldQueueInterface { use InteractsWithQueueTrait, QueueableT...
<?php namespace Shared\Cache\Jobs; use Nova\Bus\QueueableTrait; use Nova\Queue\SerializesModelsTrait; use Nova\Queue\InteractsWithQueueTrait; use Nova\Queue\ShouldQueueInterface; use Nova\Support\Facades\Cache; class FlushTagFromFileCache implements ShouldQueueInterface { use InteractsWithQueueTrait, QueueableT...
Remove `session_destroy()` call when no session present in `$response`
<?php namespace Lily\Middleware\Session; class NativeStore { public function __construct() { if ( ! session_id()) { session_start(); } } public function get(array $request) { $request['session'] = $_SESSION; return $request; } public function s...
<?php namespace Lily\Middleware\Session; class NativeStore { public function __construct() { if ( ! session_id()) { session_start(); } } public function get(array $request) { $request['session'] = $_SESSION; return $request; } public function s...
Remove left-over local extension test
<?php namespace Bolt\Tests\Nut; use Bolt\Nut\ExtensionsSetup; use Bolt\Tests\BoltUnitTest; use Symfony\Component\Console\Tester\CommandTester; /** * Class to test Bolt\Nut\ExtensionsSetup class. * * @author Gawain Lynch <gawain.lynch@gmail.com> */ class ExtensionsSetupTest extends BoltUnitTest { public funct...
<?php namespace Bolt\Tests\Nut; use Bolt\Nut\ExtensionsSetup; use Bolt\Tests\BoltUnitTest; use Symfony\Component\Console\Tester\CommandTester; /** * Class to test Bolt\Nut\ExtensionsSetup class. * * @author Gawain Lynch <gawain.lynch@gmail.com> */ class ExtensionsSetupTest extends BoltUnitTest { public funct...
Remove redundant "getBlockPrefix()" method from child form type classes.
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, 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. */ namespace Darvin\Utils\Form\Type; ...
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, 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. */ namespace Darvin\Utils\Form\Type; ...
Add headers and change the email which is generated when registering.
<?php class Email { public $db = null; public $email = ''; public $from = 'luke@lcahill.co.uk'; public $subject = 'Note Keeper - please confirm your email.'; public $message = ''; public $userId = ''; function __construct($email, $userId, $db) { $this->email = $email; $this->userId = $userId; $this->db = ...
<?php class Email { public $db = null; public $email = ''; public $from = 'luke@lcahill.co.uk'; public $subject = 'Note Keeper - please confirm your email.'; public $message = ''; public $userId = ''; public $headers = 'From: luke@lcahill.co.uk' . "\r\n" . 'Reply-To: luke@lcahill.co.uk' . "\r\n" . 'X-Mailer: PHP...
Add method to Route entity name
<?php namespace Janitor\Services\Analyzers; use Janitor\Abstracts\AbstractAnalyzer; use Janitor\Entities\Route; use Janitor\Interfaces\AnalyzerInterface; class RoutesAnalyzer extends AbstractAnalyzer implements AnalyzerInterface { /** * Compute the entities from the information * that was passed to the analyzed ...
<?php namespace Janitor\Services\Analyzers; use Janitor\Abstracts\AbstractAnalyzer; use Janitor\Entities\Route; use Janitor\Interfaces\AnalyzerInterface; class RoutesAnalyzer extends AbstractAnalyzer implements AnalyzerInterface { /** * Compute the entities from the information * that was passed to the analyzed ...
Fix symfony 5 BC deprecation alert on TreeBuilder
<?php namespace Eschmar\CssInlinerBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://...
<?php namespace Eschmar\CssInlinerBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://...
Hide form if signed in
<div class="page-header"> <div class="container"> <h1>Välkommen till Chalmers IT:s Autentiseringssystem!</h1> </div> </div> <div class="row"> <div class="col-lg-4"> <p></p> </div> <div class="col-lg-5 col-lg-offset-3"> <form role="form" class="form-horizontal" method="post" action="/auth/login.php"...
<div class="page-header"> <div class="container"> <h1>Välkommen till Chalmers IT:s Autentiseringssystem!</h1> </div> </div> <div class="row"> <div class="col-lg-4"> <p></p> </div> <?php if (!is_signed_in()): ?> <div class="col-lg-5 col-lg-offset-3"> <form role="form" class="form-horizontal" m...
Add cancel button to earnings' edit view
@extends('layout') @section('body') <div class="wrapper my-3"> <h2>{{ __('actions.edit') }} {{ __('general.earning') }}</h2> <div class="box mt-3"> <form method="POST" action="/earnings/{{ $earning->id }}" autocomplete="off"> {{ method_field('PATCH') }} {...
@extends('layout') @section('body') <div class="wrapper my-3"> <h2>{{ __('actions.edit') }} {{ __('general.earning') }}</h2> <div class="box mt-3"> <form method="POST" action="/earnings/{{ $earning->id }}" autocomplete="off"> {{ method_field('PATCH') }} {...
Revert "Used ternary operator instead of "or" for constant definition"
<?php defined('YII_DEBUG') ?: define('YII_DEBUG', false); require(__DIR__ . '/protected/vendor/yiisoft/yii2/Yii.php'); $config = [ 'id' => 'benchmark', 'basePath' => __DIR__ . '/protected', 'components' => [ 'urlManager' => [ 'enablePrettyUrl' => true, ], ], ]; $application = new yii\web\Application($con...
<?php defined('YII_DEBUG') or define('YII_DEBUG', false); require(__DIR__ . '/protected/vendor/yiisoft/yii2/Yii.php'); $config = [ 'id' => 'benchmark', 'basePath' => __DIR__ . '/protected', 'components' => [ 'urlManager' => [ 'enablePrettyUrl' => true, ], ], ]; $application = new yii\web\Application($con...
Update makeHtmlSnapshot step usage documentation
<?php namespace Codeception\Lib\Interfaces; interface PageSourceSaver { /** * Saves page source of to a file * * ```php * $this->getModule('{{MODULE_NAME}}')->_savePageSource(codecept_output_dir().'page.html'); * ``` * @api * @param $filename */ public function _savePage...
<?php namespace Codeception\Lib\Interfaces; interface PageSourceSaver { /** * Saves page source of to a file * * ```php * $this->getModule('{{MODULE_NAME}}')->_savePageSource(codecept_output_dir().'page.html'); * ``` * @api * @param $filename */ public function _savePage...
Allow array type for a parameter $params
<?php declare(strict_types=1); namespace Ray\AuraSqlModule\Pagerfanta; use Aura\Sql\ExtendedPdoInterface; interface AuraSqlPagerFactoryInterface { /** * @param array<int|string> $params */ public function newInstance(ExtendedPdoInterface $pdo, string $sql, array $params, int $paging, string $uriTe...
<?php declare(strict_types=1); namespace Ray\AuraSqlModule\Pagerfanta; use Aura\Sql\ExtendedPdoInterface; interface AuraSqlPagerFactoryInterface { /** * @param array<int|string|array<int|string>> $params */ public function newInstance(ExtendedPdoInterface $pdo, string $sql, array $params, int $pag...
Fix deprecation for symfony/config 4.2+
<?php namespace Hype\MailchimpBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { $treeBuilder = new Tre...
<?php namespace Hype\MailchimpBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { $treeBuilder = new Tre...
Fix test broken by removed deserialize() method
<?php namespace CultuurNet\UDB3\Role\Events; use PHPUnit\Framework\TestCase; use ValueObjects\Identity\UUID; class AbstractEventTest extends TestCase { /** * @var UUID */ protected $uuid; /** * @var AbstractEvent */ protected $event; protected function setUp() { ...
<?php namespace CultuurNet\UDB3\Role\Events; use PHPUnit\Framework\TestCase; use ValueObjects\Identity\UUID; class AbstractEventTest extends TestCase { /** * @var UUID */ protected $uuid; /** * @var AbstractEvent */ protected $event; protected function setUp() { ...
Replace codes to HTTP Codes.
<?php /** * @author Andrey Helldar <helldar@ai-rus.com> * * @since 2017-02-20 * @since 2017-03-08 Add statuses for user. */ return array( 1 => 'Unknown method', 2 => 'Unknown error!', 10 => 'Access denied.', 11 => 'Unauthorized.', 20 => 'Successfully.', 21 => 'Success!', 22 => 'E...
<?php /** * @author Andrey Helldar <helldar@ai-rus.com> * * @since 2017-02-20 * @since 2017-03-08 Add statuses for user. * @since 2017-03-20 Replace codes to HTTP Codes. */ return array( 1 => 'Unknown method!', 2 => 'Unknown error!', 3 => 'Access denied.', 200 => 'OK', 201 => 'Created'...
Check if orderitems is complete.
<? class Shineisp_Api_Shineisp_Ordersitems extends Shineisp_Api_Shineisp_Abstract_Action { public function checkIfComplete( $uuid ) { } }
<? class Shineisp_Api_Shineisp_Ordersitems extends Shineisp_Api_Shineisp_Abstract_Action { public function checkIfComplete( $uuid ) { $this->authenticate(); return OrdersItems::checkIfCompletedByUUID($uuid); } }
Use specific skipped testSetMultipleWithIntegerArrayKey now it is merged
<?php declare(strict_types = 1); namespace RoaveTest\DoctrineSimpleCache; use Cache\IntegrationTests\SimpleCacheTest; use Doctrine\Common\Cache\ArrayCache; use Roave\DoctrineSimpleCache\SimpleCacheAdapter; /** * @coversNothing */ final class CacheIntegrationTest extends SimpleCacheTest { /** * @return \Ps...
<?php declare(strict_types = 1); namespace RoaveTest\DoctrineSimpleCache; use Cache\IntegrationTests\SimpleCacheTest; use Doctrine\Common\Cache\ArrayCache; use Roave\DoctrineSimpleCache\SimpleCacheAdapter; /** * @coversNothing */ final class CacheIntegrationTest extends SimpleCacheTest { /** * @return \Ps...
Send HTTP code when cron is too much executed
<?php /** * @author Pierre-Henry Soria <ph7software@gmail.com> * @copyright (c) 2012-2016, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / Include / Class */ n...
<?php /** * @author Pierre-Henry Soria <ph7software@gmail.com> * @copyright (c) 2012-2016, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / Include / Class */ n...
Update status color based on response code
<?php /** * Class Sheep_Debug_Block_Controller * * @category Sheep * @package Sheep_Debug * @license Copyright: Pirate Sheep, 2016, All Rights reserved. * @link https://piratesheep.com */ class Sheep_Debug_Block_Controller extends Sheep_Debug_Block_Panel { public function getSubTitle() ...
<?php /** * Class Sheep_Debug_Block_Controller * * @category Sheep * @package Sheep_Debug * @license Copyright: Pirate Sheep, 2016, All Rights reserved. * @link https://piratesheep.com */ class Sheep_Debug_Block_Controller extends Sheep_Debug_Block_Panel { public function getSubTitle() ...
Use willReturn() instead of will(returnValue()).
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Tests\Iterator; /** * @author Alex Bogomazov ...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Tests\Iterator; /** * @author Alex Bogomazov ...
Use camel case yaml naming strategy instead of lower camel case
<?php /* * This file is part of the FixtureDumper library. * * (c) Martin Parsiegla <martin.parsiegla@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sp\FixtureDumper\Generator\Alice; use Symfony\Component\Y...
<?php /* * This file is part of the FixtureDumper library. * * (c) Martin Parsiegla <martin.parsiegla@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sp\FixtureDumper\Generator\Alice; use Symfony\Component\Y...
Clear superfluous use statements in example
<?php use Amp\Success; use Aerys\Websocket; use Aerys\Websocket\Broadcast; class ExampleWebsocket implements Websocket { private $clientCount = 0; public function onOpen($clientId, array $httpEnvironment) { $msg = json_encode(['type' => 'count', 'data' => ++$this->clientCount]); // Broadcast...
<?php class ExampleWebsocket implements Aerys\Websocket { private $clientCount = 0; public function onOpen($clientId, array $httpEnvironment) { $msg = json_encode(['type' => 'count', 'data' => ++$this->clientCount]); // Broadcast the current user count to all users. Yielding the // "b...
Remove Zend\Router module from V2 configuration
<?php return [ 'modules' => [ 'Zend\Router', 'DoctrineModule', 'DoctrineMongoODMModule', ], 'module_listener_options' => [ 'config_glob_paths' => [ __DIR__ . '/testing.config.php', ], 'module_paths' => [ '../vendor', ], ...
<?php return [ 'modules' => [ 'DoctrineModule', 'DoctrineMongoODMModule', ], 'module_listener_options' => [ 'config_glob_paths' => [ __DIR__ . '/testing.config.php', ], 'module_paths' => [ '../vendor', ], ], ];
Fix typo in loging page causing fatal error
<?php defined('C5_EXECUTE') or die('Access denied.'); $form = Loader::helper('form'); ?> <div class='row'> <div class='span5'> <div class='control-group'> <label class='control-label' for="uName"> <?=USER_REGISTRATION_WITH_EMAIL_ADDRESS?t('Email Address'):t('Username')?> </label> <div class='controls'> ...
<?php defined('C5_EXECUTE') or die('Access denied.'); $form = Loader::helper('form'); ?> <div class='row'> <div class='span5'> <div class='control-group'> <label class='control-label' for="uName"> <?=USER_REGISTRATION_WITH_EMAIL_ADDRESS?t('Email Address'):t('Username')?> </label> <div class='controls'> ...
Send reset password mail via queue
<?php namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; class PasswordResetMail extends Mailable { use Queueable, SerializesModels; /** * Create a new message instance. * * @return void */ public function __construc...
<?php namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; class PasswordResetMail extends Mailable implements ShouldQueue { use Queueable, SerializesModels; public $content; /** *...
Add logging to InfoStart debugging
<?php set_time_limit(0); // Configuration include 'config/config.php'; // Version Functions include 'functions/getVersion.php'; include 'functions/checkVersion.php'; // Debugging Functions include 'functions/debug.php'; // Stats Functions include 'functions/loadAvg.php'; include 'functions/memory.php'; include 'fun...
<?php set_time_limit(0); // Configuration include 'config/config.php'; // Version Functions include 'functions/getVersion.php'; include 'functions/checkVersion.php'; // Debugging Functions include 'functions/debug.php'; // Stats Functions include 'functions/loadAvg.php'; include 'functions/memory.php'; include 'fun...
Improve IN clause in WHERE
<?php namespace BW\BlogBundle\Entity; use Doctrine\ORM\EntityRepository; /** * PostRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class PostRepository extends EntityRepository { public function findNestedBy($left, $right) { $qb = ...
<?php namespace BW\BlogBundle\Entity; use Doctrine\ORM\EntityRepository; /** * PostRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class PostRepository extends EntityRepository { public function findNestedBy($left, $right) { $reque...
FIX GraphQL test warnings when they do not assert anything
<?php namespace Github\Tests\Api; class GraphQLTest extends TestCase { /** * @test */ public function shouldTestGraphQL() { $api = $this->getApiMock(); $api->expects($this->once()) ->method('post') ->with($this->equalTo('/graphql'), $this->equalTo(['query...
<?php namespace Github\Tests\Api; class GraphQLTest extends TestCase { /** * @test */ public function shouldTestGraphQL() { $api = $this->getApiMock(); $api->expects($this->once()) ->method('post') ->with($this->equalTo('/graphql'), $this->equalTo(['query...
Remove obsolete passed argument in config() call
<?php namespace Drubo\EventSubscriber; use Drubo\DruboAwareTrait; use Symfony\Component\Console\Event\ConsoleCommandEvent; /** * Event subscriber: Console command. */ class ConsoleCommandSubscriber { use DruboAwareTrait; /** * Check whether a console command is disabled. * * @param \Symfony\Componen...
<?php namespace Drubo\EventSubscriber; use Drubo\DruboAwareTrait; use Symfony\Component\Console\Event\ConsoleCommandEvent; /** * Event subscriber: Console command. */ class ConsoleCommandSubscriber { use DruboAwareTrait; /** * Check whether a console command is disabled. * * @param \Symfony\Componen...
Add a weekly update job for the endpoint resources
<?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { protected function schedule(Schedule $schedule) { // TODO: Re-add a cleanup command for outdated spec builds //$schedule->co...
<?php namespace App\Console; use App\Jobs\ResourcesUpdateJob; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { protected function schedule(Schedule $schedule) { // TODO: Re-add a cleanup command for outdated sp...
Change visibility from public to protected
<?php /** * vt Smarty Extension Demo * Copyright (C) 2013 Marat Bedoev * * This file is part of TOXID Module for OXID eShop CE/PE/EE. * * TOXID is free software: you can redistribute it and/or modify * it under the terms of the MIT License. * * * @link https://github.com/vanilla-thunder/vt-smar...
<?php /** * vt Smarty Extension Demo * Copyright (C) 2013 Marat Bedoev * * This file is part of TOXID Module for OXID eShop CE/PE/EE. * * TOXID is free software: you can redistribute it and/or modify * it under the terms of the MIT License. * * * @link https://github.com/vanilla-thunder/vt-smar...
Disable auto fetch by default
<?php /////////////////////////////////////// // Config. $config["info"] = array( "debug" => FALSE, "version" => "1.0", "title" => "The OpenGL vs Mesa matrix", "description" => "Show Mesa progress for the OpenGL implementation into an easy to read HTML page.", "git_url" => "http://cgit.freedesktop....
<?php /////////////////////////////////////// // Config. $config["info"] = array( "debug" => FALSE, "version" => "1.0", "title" => "The OpenGL vs Mesa matrix", "description" => "Show Mesa progress for the OpenGL implementation into an easy to read HTML page.", "git_url" => "http://cgit.freedesktop....
Split CsrfTokenGenerator into CsrfTokenManager and TokenGenerator
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\Twig\Form; use Symfony\Component\Form\FormRenderer; use ...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\Twig\Form; use Symfony\Component\Form\Exception\Unexpect...
Add function to calculate distance between points
<?php namespace GeoTools\Model; final class Point2D { /** * @var double */ public $x; /** * @var double */ public $y; /** * @param double $x * @param double $y */ public function __construct($x, $y) { $this->x = $x; $this->y = $y; } ...
<?php namespace GeoTools\Model; final class Point2D { /** * @var double */ public $x; /** * @var double */ public $y; /** * @param double $x * @param double $y */ public function __construct($x, $y) { $this->x = $x; $this->y = $y; } ...
Fix file path for test
<?php require_once "../../classes/Validators/ArrValueExists.php"; class ArrValueExistsTest extends PHPUnit_Framework_TestCase { public function setUp() { $this->validator = new Validators_ArrValueExists(); } public function testEmptyValue() { $arr = array(""); $this->assertEqua...
<?php require_once "../ArrValueExists.php"; class ArrValueExistsTest extends PHPUnit_Framework_TestCase { public function setUp() { $this->validator = new Validators_ArrValueExists(); } public function testEmptyValue() { $arr = array(""); $this->assertEquals(0, $this->validator...
Add Condition\Different test for type Datetime
<?php use Mdd\QueryBuilder\Type; use Mdd\QueryBuilder\Types; use Mdd\QueryBuilder\Conditions; use Mdd\QueryBuilder\Tests\Escapers\SimpleEscaper; class DifferentTest extends PHPUnit_Framework_TestCase { protected $escaper; protected function setUp() { $this->escaper = new SimpleEscaper(); ...
<?php use Mdd\QueryBuilder\Type; use Mdd\QueryBuilder\Types; use Mdd\QueryBuilder\Conditions; use Mdd\QueryBuilder\Tests\Escapers\SimpleEscaper; class DifferentTest extends PHPUnit_Framework_TestCase { protected $escaper; protected function setUp() { $this->escaper = new SimpleEscaper(); ...
Fix a bug, when token ReflectionClass throws an exception that class is not an interface
<?php /** * Go! OOP&AOP PHP framework * * @copyright Copyright 2012, Lissachenko Alexander <lisachenko.it@gmail.com> * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ namespace Go\Aop\Support; use ReflectionClass; use Go\Aop\PointFilter; use TokenReflection\ReflectionCla...
<?php /** * Go! OOP&AOP PHP framework * * @copyright Copyright 2012, Lissachenko Alexander <lisachenko.it@gmail.com> * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ namespace Go\Aop\Support; use ReflectionClass; use Go\Aop\PointFilter; use TokenReflection\ReflectionCla...
Update form_results link in submission email template
<? defined('C5_EXECUTE') or die(_("Access Denied.")); $submittedData=''; foreach($questionAnswerPairs as $questionAnswerPair){ $submittedData .= $questionAnswerPair['question']."\r\n".$questionAnswerPair['answer']."\r\n"."\r\n"; } $formDisplayUrl=BASE_URL.DIR_REL.'/index.php/dashboard/form_results/?qsid='.$question...
<? defined('C5_EXECUTE') or die(_("Access Denied.")); $submittedData=''; foreach($questionAnswerPairs as $questionAnswerPair){ $submittedData .= $questionAnswerPair['question']."\r\n".$questionAnswerPair['answer']."\r\n"."\r\n"; } $formDisplayUrl=BASE_URL.DIR_REL.'/index.php/dashboard/reports/forms/?qsid='.$questio...
Enable to use env variable.
<?php return [ /* |---------------------------------------------------------------------- | Default Driver |---------------------------------------------------------------------- | | Set default driver for Orchestra\Memory. | */ 'driver' => 'fluent.default', /* |---------...
<?php return [ /* |---------------------------------------------------------------------- | Default Driver |---------------------------------------------------------------------- | | Set default driver for Orchestra\Memory. | */ 'driver' => env('MEMORY_DRIVER', 'fluent.default'), ...
Update the admin interface and demo site generator
<?php namespace Kunstmaan\TaggingBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Kunstmaan\TaggingBundle\Entity\TagManager; use Kunstmaan\TaggingBundle\Form\DataTransformer\TagsTransformer; use Symfony\Component\OptionsResolver\OptionsResolverInterface; cla...
<?php namespace Kunstmaan\TaggingBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Kunstmaan\TaggingBundle\Entity\TagManager; use Kunstmaan\TaggingBundle\Form\DataTransformer\TagsTransformer; use Symfony\Component\OptionsResolver\OptionsResolverInterface; cla...
Fix the configuration property access
<?php namespace PHPYAM\extra; use PHPYAM\core\interfaces\IConfiguration; /** * TODO comment. * * @package PHPYAM\extra * @author Thierry BLIND * @since 01/04/2022 * @copyright 2014-2022 Thierry BLIND */ class Configuration implements IConfiguration { /** * * {@inheritdoc} ...
<?php namespace PHPYAM\extra; use PHPYAM\core\interfaces\IConfiguration; /** * TODO comment. * * @package PHPYAM\extra * @author Thierry BLIND * @since 01/04/2022 * @copyright 2014-2022 Thierry BLIND */ class Configuration implements IConfiguration { /** * * {@inheritdoc} ...
Make the envelope stripping in wrap smarter
<?php namespace Purplapp\Adn; use stdClass; use GuzzleHttp\Message\Response; trait DataContainerTrait { private $data = []; private $dataEnvelope = []; public static function wrap($data) { if ($data instanceof stdClass) { return static::wrapObject($data); } elseif ($data ...
<?php namespace Purplapp\Adn; use stdClass; use GuzzleHttp\Message\Response; trait DataContainerTrait { private $data = []; private $dataEnvelope = []; public static function wrap($data) { if ($data instanceof stdClass) { return static::wrapObject($data); } elseif ($data ...
Include test for invalid input
<?php namespace Zend\Romans\View\Helper; use PHPUnit\Framework\TestCase; use Zend\View\Helper\HelperInterface; /** * Roman Test */ class RomanTest extends TestCase { /** * {@inheritdoc} */ protected function setUp() { $this->helper = new Roman(); } /** * Test Instance Of...
<?php namespace Zend\Romans\View\Helper; use PHPUnit\Framework\TestCase; use Zend\View\Helper\HelperInterface; /** * Roman Test */ class RomanTest extends TestCase { /** * {@inheritdoc} */ protected function setUp() { $this->helper = new Roman(); } /** * Test Instance Of...
Add autofocus for the 2FA code
<form method="post" action="<?= $this->u('twofactor', 'check', array('user_id' => $this->userSession->getId())) ?>" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formLabel(t('Code'), 'code') ?> <?= $this->formText('code', array(), array(), array('placeholder="123456"'), 'form-numeric') ?> <d...
<form method="post" action="<?= $this->u('twofactor', 'check', array('user_id' => $this->userSession->getId())) ?>" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formLabel(t('Code'), 'code') ?> <?= $this->formText('code', array(), array(), array('placeholder="123456"', 'autofocus'), 'form-numeric...
Add warning icons to some alerts
@if (App::environment() !== 'production') <div class="alert alert-warning"> <p>This installation of OpenDominion is running on <b>{{ App::environment() }}</b> environment and is not meant for production purposes. Any data you register and actions you take on this instance might be wiped without notice.</p> ...
@if (App::environment() !== 'production') <div class="alert alert-warning"> <p><i class="icon fa fa-warning"></i> This installation of OpenDominion is running on <b>{{ App::environment() }}</b> environment and is not meant for production purposes. Any data you register and actions you take on this instance ...
Use config helper & update config key
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRoleUserTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('role_user', function (Blueprint $table) { ...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRoleUserTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('role_user', function (Blueprint $table) { ...
Add ability to get ISO4217 info. add a request and action for that. Simply payment interface.
<?php namespace Payum\AuthorizeNet\Aim\Action; use Payum\Core\Action\ActionInterface; use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; use Payum\Core\Model\PaymentInterface; use Payum\Core\Request\Convert; class ConvertPaymentAction implements ActionInterface { /** ...
<?php namespace Payum\AuthorizeNet\Aim\Action; use Payum\Core\Action\ActionInterface; use Payum\Core\Action\GatewayAwareAction; use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; use Payum\Core\Model\PaymentInterface; use Payum\Core\Request\Convert; use Payum\Core\Request\Get...
Check if the model is empty first in collection relationship
<?php namespace EGALL\Transformer\Relationships; use EGALL\Transformer\Relationship; /** * ModelToCollectionRelationship Class * * @package EGALL\Transformer\Relationships * @author Erik Galloway <erik@mybarnapp.com> */ class ModelToCollectionRelationship extends Relationship { /** * Transform a model...
<?php namespace EGALL\Transformer\Relationships; use EGALL\Transformer\Relationship; /** * ModelToCollectionRelationship Class * * @package EGALL\Transformer\Relationships * @author Erik Galloway <erik@mybarnapp.com> */ class ModelToCollectionRelationship extends Relationship { /** * Transform a model...
Fix setup for table trl test
<?php class Kwc_Trl_Table_Root_Master extends Kwc_Abstract { public static function getSettings() { $ret = parent::getSettings(); $ret['generators']['table'] = array( 'class' => 'Kwf_Component_Generator_Page_Static', 'component' => 'Kwc_Trl_Table_Table_Component', ...
<?php class Kwc_Trl_Table_Root_Master extends Kwc_Root_TrlRoot_Master_Component { public static function getSettings() { $ret = parent::getSettings(); $ret['generators']['table'] = array( 'class' => 'Kwf_Component_Generator_Page_Static', 'component' => 'Kwc_Trl_Table_Tabl...
Switch license from MIT to AGPL in plugin file
<?php /* Plugin Name: Castlegate IT WP Show ID Plugin URI: http://github.com/castlegateit/cgit-wp-show-id Description: Show post and page ID in WordPress admin panel. Version: 1.1 Author: Castlegate IT Author URI: http://www.castlegateit.co.uk/ License: MIT */ if (!defined('ABSPATH')) { wp_die('Access denied');...
<?php /* Plugin Name: Castlegate IT WP Show ID Plugin URI: http://github.com/castlegateit/cgit-wp-show-id Description: Show post and page ID in WordPress admin panel. Version: 1.1 Author: Castlegate IT Author URI: http://www.castlegateit.co.uk/ License: AGPL */ if (!defined('ABSPATH')) { wp_die('Access denied')...