Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Debug info is no longer returned automatically with every exception. Use Factual::debug() instead.
<?php /** * Represents an Exception that happened while communicating with Factual. * Includes information about the request that triggered the problem. * This is a refactoring of the Factual Driver by Aaron: https://github.com/Factual/factual-java-driver * @author Tyler * @package Factual * @license Apache 2.0 ...
<?php /** * Represents an Exception that happened while communicating with Factual. * Includes information about the request that triggered the problem. * This is a refactoring of the Factual Driver by Aaron: https://github.com/Factual/factual-java-driver * @author Tyler * @package Factual * @license Apache 2.0 ...
Add error handling upon failure to parse MPD content as XMl
<?php class DeliveryProfileLiveDash extends DeliveryProfileLive { function __construct() { parent::__construct(); $this->DEFAULT_RENDERER_CLASS = 'kRedirectManifestRenderer'; } public function checkIsLive($url) { $content = $this->urlExists($url, array('application/dash+xml')); if(!$content) { retu...
<?php class DeliveryProfileLiveDash extends DeliveryProfileLive { function __construct() { parent::__construct(); $this->DEFAULT_RENDERER_CLASS = 'kRedirectManifestRenderer'; } public function checkIsLive($url) { $content = $this->urlExists($url, array('application/dash+xml')); if(!$content) { retu...
Fix line endings and check returned type.
<?php /** * This file is part of the Minty templating library. * (c) Dániel Buga <daniel@bugadani.hu> * * For licensing information see the LICENSE file. */ namespace Minty\Compiler\Tags; use Minty\Compiler\Nodes\DataNode; use Minty\Compiler\Parser; use Minty\Compiler\Stream; use Minty\Compiler\Tag; use Minty\C...
<?php /** * This file is part of the Minty templating library. * (c) Dániel Buga <daniel@bugadani.hu> * * For licensing information see the LICENSE file. */ namespace Minty\Compiler\Tags; use Minty\Compiler\Nodes\DataNode; use Minty\Compiler\Nodes\FunctionNode; use Minty\Compiler\Parser; use Minty\Compiler\Stre...
Make usage of parse_str() cleaner
<?php /* * This file is part of the Purl package, a project by Jonathan H. Wage. * * (c) 2013 Jonathan H. Wage * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Purl; /** * Query represents the part of a Url after the q...
<?php /* * This file is part of the Purl package, a project by Jonathan H. Wage. * * (c) 2013 Jonathan H. Wage * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Purl; /** * Query represents the part of a Url after the q...
Improve phrasing of note and wrap at 80 chars
<?php namespace Sil\SilAuth\saml; class User { public static function convertToSamlFieldNames( string $employeeId, string $firstName, string $lastName, string $username, string $email, string $uuid, string $idpDomainName, $passwordExpirationDate, ...
<?php namespace Sil\SilAuth\saml; class User { public static function convertToSamlFieldNames( string $employeeId, string $firstName, string $lastName, string $username, string $email, string $uuid, string $idpDomainName, $passwordExpirationDate, ...
Make the box URL be an actual link in the sample Vagrantfile snippets
<?php /* @var string $boxName */ /* @var string $provider */ /* @var string $manifestUrl */ ?> VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "<?php echo $boxName; ?>" config.vm.box_url = "<?php echo $manifestUrl; ?>" end
<?php /* @var string $boxName */ /* @var string $provider */ /* @var string $manifestUrl */ ?> VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "<?php echo $boxName; ?>" config.vm.box_url = "<a href="<?php echo $manifestUrl; ?>"><?php echo $manifestUrl; ?>...
Set name for users in migration
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddPasswordAndUsernameFields extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function(Blueprint $table) { ...
<?php use DB; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddPasswordAndUsernameFields extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function(Blueprint $table) { ...
Add support for testing URL redirects.
<?php /* * Bear CMS addon for Bear Framework * https://bearcms.com/ * Copyright (c) Amplilabs Ltd. * Free to use under the MIT license. */ namespace BearCMS\Internal; use BearFramework\App; /** * @internal * @codeCoverageIgnore */ class Settings { /** * * @param App $app * @param \BearC...
<?php /* * Bear CMS addon for Bear Framework * https://bearcms.com/ * Copyright (c) Amplilabs Ltd. * Free to use under the MIT license. */ namespace BearCMS\Internal; use BearFramework\App; /** * @internal * @codeCoverageIgnore */ class Settings { /** * * @param App $app * @param \BearC...
Clean up post excerpt on home page.
<?php /** * @package Victorian Climbing Club */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?> <?php if ( 'post' == get_post_type() )...
<?php /** * @package Victorian Climbing Club */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?> <?php if ( 'post' == get_post_type() )...
Add virtual hook test case
<?php /** * This file is part of CaptainHook. * * (c) Sebastian Feldmann <sf@sebastian-feldmann.info> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace CaptainHook\App; use PHPUnit\Framework\TestCase; class HooksTest ex...
<?php /** * This file is part of CaptainHook. * * (c) Sebastian Feldmann <sf@sebastian-feldmann.info> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace CaptainHook\App; use Exception; use PHPUnit\Framework\TestCase; cla...
Use is_null to check if a state isn't available.
<?php /** * @version $Id: default_filter.php 1696 2011-06-10 16:00:55Z tomjanssens $ * @category Nooku * @package Nooku_Server * @subpackage Banners * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> *...
<?php /** * @version $Id: default_filter.php 1696 2011-06-10 16:00:55Z tomjanssens $ * @category Nooku * @package Nooku_Server * @subpackage Banners * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> *...
Update service provider for 5.3.
<?php namespace LaravelColors; use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class LaravelColorsServiceProvider extends ServiceProvider { /** * Register any other events for your application. * ...
<?php namespace LaravelColors; use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class LaravelColorsServiceProvider extends ServiceProvider { /** * Register any other events for your application. */ ...
Refactor the code a bit
<?php /** * Returns the absolute URL of a theme asset. * * @param string $relative_url If the URL starts with `@bower/`, the prefix will be the value of * $GLOBALS['bower_components_root_url'] if it exists * @param boolean $escape * * @return string */ function _fswpt_get_asset($r...
<?php /** * Returns the absolute URL of a theme asset. * * @param string $relative_url If the URL starts with `@bower/`, the prefix will be the value of * $GLOBALS['bower_components_root_url'] if it exists * @param boolean $escape * * @return string */ function _fswpt_get_asset($r...
Fix Call to undefined method DOMNodeList::getElementsByTagName()
<?php namespace Omnipay\SecureTrading\Message; use DOMDocument; /** * ThreeDSecure Request * * @method ThreeDSecureResponse send() */ class ThreeDSecureRequest extends AbstractPurchaseRequest { /** * @return string */ public function getAction() { return 'THREEDQUERY'; } /*...
<?php namespace Omnipay\SecureTrading\Message; use DOMDocument; /** * ThreeDSecure Request * * @method ThreeDSecureResponse send() */ class ThreeDSecureRequest extends AbstractPurchaseRequest { /** * @return string */ public function getAction() { return 'THREEDQUERY'; } /*...
Add default config for tracing
<?php return [ "info" => true, "warning" => true, "error" => true, "infoDisplay" => false, "warningDisplay" => true, "errorDisplay" => true ]; ?>
<?php return [ "info" => true, "warning" => true, "error" => true, "infoDisplay" => false, "warningDisplay" => true, "errorDisplay" => true, "infoTrace" => true, "warningTrace" => true, "errorTrace" => true ]; ?>
Set return with config SentinelBootstraper instance
<?php if (!function_exists('auth')) { function auth() { return sentinel(); } } if (!function_exists('sentinel')) { function sentinel() { return Cartalyst\Sentinel\Native\Facades\Sentinel::instance()->getSentinel(); } } if (!function_exists('user')) { function user($user = ...
<?php if (!function_exists('auth')) { function auth() { return sentinel(); } } if (!function_exists('sentinel')) { function sentinel() { $config = new Library\Sentinel\SentinelBootstrapper(__DIR__.'/../config/sentinel.php'); return Cartalyst\Sentinel\Native\Facades\Sentine...
Update the CanBuildBaseString test trait.
<?php use PHPUnit\Framework\TestCase; use Risan\OAuth1\Signature\CanBuildBaseString; use Risan\OAuth1\Signature\BaseStringBuilderInterface; class CanBuildBaseStringTest extends TestCase { private $canBuildBaseString; function setUp() { $this->canBuildBaseString = $this->getMockForTrait(CanBuildBa...
<?php use PHPUnit\Framework\TestCase; use Risan\OAuth1\Signature\CanBuildBaseString; use Risan\OAuth1\Signature\BaseStringBuilderInterface; class CanBuildBaseStringTest extends TestCase { private $canBuildBaseStringStub; function setUp() { $this->canBuildBaseStringStub = $this->getMockForTrait(Ca...
Change the wording and link directly to packagist.org.
<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Command; use Symfony\Component\...
<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Command; use Symfony\Component\...
Update to load the .env file using existing technologies.
<?php return [ /* * Database connections * Currently only SQLite & mySQL are set up * others to come soon */ 'connections' => [ 'sqlite' => [ 'driver' => 'sqlite', 'database' => getenv('DATABASE_PATH'), ], 'mysql' => [ 'driver...
<?php if (!getenv('DATABASE_PATH')) { // crank up the Composer autoloading require __DIR__.'/../vendor/autoload.php'; // load environment variables \Lib\Framework\EnvVarsLoader::loadEnvVars(); } return [ /* * Database connections * Currently only SQLite & mySQL are set up * others ...
Fix duplicate call to licenses seeder
<?php use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); $this->call(CompanySeeder::class); $this->call(Catego...
<?php use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); $this->call(CompanySeeder::class); $this->call(Catego...
Allow passing of constructor arguments on make method helper.
<?php namespace Yajra\DataTables\Html; use BadMethodCallException; use Yajra\DataTables\Contracts\DataTableHtmlBuilder; /** * @mixin Builder */ abstract class DataTableHtml implements DataTableHtmlBuilder { /** * @var \Yajra\DataTables\Html\Builder */ protected $htmlBuilder; /** * @retu...
<?php namespace Yajra\DataTables\Html; use BadMethodCallException; use Yajra\DataTables\Contracts\DataTableHtmlBuilder; /** * @mixin Builder */ abstract class DataTableHtml implements DataTableHtmlBuilder { /** * @var \Yajra\DataTables\Html\Builder */ protected $htmlBuilder; /** * @retu...
Add empty return to Telegram webhook.
<?php namespace App\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use TelegramBot\Api\BotApi; use TelegramBot\Api\Client as TelegramClient; use TelegramBot\Api\Exception as TelegramException; use TelegramBot\Api\Types\Message as Telegr...
<?php namespace App\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use TelegramBot\Api\BotApi; use TelegramBot\Api\Client as TelegramClient; use TelegramBot\Api\Exception as TelegramException; use TelegramBot\Api\Types\Message as Telegr...
Fix incompatible override of Exception's built-in message member
<?php namespace Emergence\Connectors\Exceptions; class SyncException extends \Exception { private $message; private $context; public function __construct($message, array $context = []) { $this->message = $message; $this->context = $context; return parent::__construct($message...
<?php namespace Emergence\Connectors\Exceptions; class SyncException extends \Exception { protected $context; public function __construct($message, array $context = []) { $this->message = $message; $this->context = $context; return parent::__construct($message); } public...
Remove references to "multiple addressbooks" :-(
<?php // Include Style and Script OC_Util::addScript('contacts','interface'); OC_Util::addStyle('contacts','styles'); ?> <?php /*<div class="contacts_addressbooks"> <div class="contacts_addressbooksexpander"> Addressbooks </div> <div class="contacts_addressbooksdetails" style="display:none;"> <?php foreach($_['...
<?php // Include Style and Script OC_Util::addScript('contacts','interface'); OC_Util::addStyle('contacts','styles'); ?> <div id="contacts_contacts" class="leftcontent"> <ul> <?php echo $this->inc("part.contacts"); ?> </ul> <a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a> </div> <div id="contac...
Remove debugging from GET method.
<?php /** * @file * GET Apple News Article. */ namespace ChapterThree\AppleNews; /** * Document me. */ class PushAPI_Get extends PushAPI_Base { protected function Debug($response) { print_r($response);exit; } }
<?php /** * @file * GET Apple News Article. */ namespace ChapterThree\AppleNews; /** * Document me. */ class PushAPI_Get extends PushAPI_Base { }
FIX public attribute issue while creating defect
<?php namespace Solidifier\Visitors\Property; use Solidifier\Visitors\AbstractClassVisitor; use PhpParser\Node; use PhpParser\Node\Stmt\Property; class PublicAttributes extends AbstractClassVisitor { public function enterNode(Node $node) { parent::enterNode($node); if($node instanceo...
<?php namespace Solidifier\Visitors\Property; use Solidifier\Visitors\AbstractClassVisitor; use PhpParser\Node; use PhpParser\Node\Stmt\Property; class PublicAttributes extends AbstractClassVisitor { public function enterNode(Node $node) { parent::enterNode($node); if($node instanceo...
Add JWT content type constant
<?php namespace JWX\JWT\Parameter; /** * Implements 'Content Type' parameter. * * @link https://tools.ietf.org/html/rfc7515#section-4.1.10 */ class ContentTypeParameter extends RegisteredJWTParameter { /** * Constructor * * @param string $type */ public function __construct($type) { parent::__constru...
<?php namespace JWX\JWT\Parameter; /** * Implements 'Content Type' parameter. * * @link https://tools.ietf.org/html/rfc7515#section-4.1.10 */ class ContentTypeParameter extends RegisteredJWTParameter { /** * Content type for the nested JWT. * * @var string */ const TYPE_JWT = "JWT"; /** * Construc...
Remove code form json response
<?php namespace intpp\yii\actions; /** * Class JsonResponse * * @package intpp\yii\actions */ class JsonResponse extends Response { public function prepare($data = []) { header('Content-type: application/json'); return \CJSON::encode(array_merge(['code' => 0], $data)); } }
<?php namespace intpp\yii\actions; /** * Class JsonResponse * * @package intpp\yii\actions */ class JsonResponse extends Response { public function prepare($data = []) { header('Content-type: application/json'); return \CJSON::encode($data); } }
Add correct clases to factory
<?php abstract class Dao_Factory { abstract public function setConnection($conn); abstract public function getConnection(); abstract public function getSpotDao(); abstract public function getSpotSearchDao(); abstract public function getUserDao(); abstract public function getCacheDao(); abstract public function...
<?php abstract class Dao_Factory { abstract public function setConnection($conn); abstract public function getConnection(); abstract public function getSpotDao(); abstract public function getSpotSearchDao(); abstract public function getUserDao(); abstract public function getCacheDao(); abstract public function...
Set to null instead of unsetting
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyrig...
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyrig...
Add provides method to service provider
<?php namespace Frozzare\Tank; use BadMethodCallException; abstract class Service_Provider { /** * The container. * * @var \Frozzare\Tank\Container */ protected $container; /** * The constructor. * * @param \Frozzare\Tank\Container $container */ public function __construct( Container $container...
<?php namespace Frozzare\Tank; use BadMethodCallException; abstract class Service_Provider { /** * The container. * * @var \Frozzare\Tank\Container */ protected $container; /** * The constructor. * * @param \Frozzare\Tank\Container $container */ public function __construct( Container $container...
Make sure the connection exists before setting it
<?php namespace adLDAP\Classes; use adLDAP\adLDAP; /** * The base adLDAP class * * Class adLDAPBase * @package adLDAP\classes */ class adLDAPBase { /** * The current adLDAP connection via dependency injection * * @var adLDAP */ protected $adldap; /** * The current adLDAP co...
<?php namespace adLDAP\Classes; use adLDAP\adLDAP; /** * The base adLDAP class * * Class adLDAPBase * @package adLDAP\classes */ class adLDAPBase { /** * The current adLDAP connection via dependency injection * * @var adLDAP */ protected $adldap; /** * The current adLDAP co...
Add serviço Auth no construtor
<?php class CadastroController extends \HXPHP\System\Controller { public function cadastrarAction() { $this->view->setFile('index'); $this->request->setCustomFilters(array( 'email' => FILTER_VALIDATE_EMAIL )); $post = $this->request->post(); if (!empty($post)) { $cadastrarUsuario = User::cadastrar...
<?php class CadastroController extends \HXPHP\System\Controller { public function __construct($configs) { parent::__construct($configs); $this->load( 'Services\Auth', $configs->auth->after_login, $configs->auth->after_logout, TRUE ); ...
Update factories to use uk/en/ru languages
<?php /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | | Here you may define all of your model factories. Model factories give | you a convenient way to create models for testing and seeding yo...
<?php /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | | Here you may define all of your model factories. Model factories give | you a convenient way to create models for testing and seeding yo...
Save action meat as JSON
<?php namespace BenAllfree\Trackable\Models; use Illuminate\Database\Eloquent\Model; class Action extends Model { protected $fillable = ['contact_id', 'event', 'ip_address', 'user_agent', 'referer', 'url', 'exited_at', 'request_method']; protected $dates = ['created_at', 'updated_at', 'exited_at']; static f...
<?php namespace BenAllfree\Trackable\Models; use Illuminate\Database\Eloquent\Model; class Action extends Model { protected $fillable = ['contact_id', 'event', 'ip_address', 'user_agent', 'referer', 'url', 'exited_at', 'request_method']; protected $dates = ['created_at', 'updated_at', 'exited_at']; static f...
Revert "Revert "Revert "I don't know what changed"""
<?php get_template_part('templates/head'); ?> <body <?php body_class(); ?>> <!--[if lt IE 8]> <div class="alert alert-warning"> <?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots'); ?> </di...
<?php get_template_part('templates/head'); ?> <body <?php body_class(); ?>> <!--[if lt IE 8]> <div class="alert alert-warning"> <?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots'); ?> </di...
Add data property for view's data.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * Base controller for public controllers. * * @package CI-Beam * @category Controller * @author Ardi Soebrata * * @property CI_Loader $load * @property CI_Form_validation $form_validation * @property CI_Input $input * @property ...
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * Base controller for public controllers. * * @package CI-Beam * @category Controller * @author Ardi Soebrata * * @property CI_Config $config * @property CI_Loader $load * @property MY_Form_validation $form_validation * @propert...
Change variable name defining path to ChromeDriver executable
<?php // Copyright 2004-present Facebook. All Rights Reserved. // // 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 b...
<?php // Copyright 2004-present Facebook. All Rights Reserved. // // 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 b...
Fix after an API modification
<?php $vca_page_title = _('Server Virtual Control Admin'); $paquet = new Paquet(); if(!empty($_GET['server'])) { if(!empty($_POST['name'])) { $para = array('name', 'address', 'key','description'); if(!empty($_POST['name'])) { $para['name'] = $_POST['name']; } if(!empty($_POST['address'])) { $para[...
<?php $vca_page_title = _('Server Virtual Control Admin'); $paquet = new Paquet(); if(!empty($_GET['server'])) { if(!empty($_POST['name'])) { $para = array('name', 'address', 'key','description'); if(!empty($_POST['name'])) { $para['name'] = $_POST['name']; } if(!empty($_POST['address'])) { $para[...
Fix warning for foreign key detection
<?php /** * PHP version 7.1 * * This source file is subject to the license that is bundled with this package in the file LICENSE. */ namespace ComPHPPuebla\Fixtures\Processors; class ForeignKeyProcessor implements Processor { /** @var array */ protected $references; public function __construct() {...
<?php /** * PHP version 7.1 * * This source file is subject to the license that is bundled with this package in the file LICENSE. */ namespace ComPHPPuebla\Fixtures\Processors; class ForeignKeyProcessor implements Processor { /** @var array */ protected $references; public function __construct() {...
Add shortcut prefix for child axis
<?php namespace FluentDOM\PhpCss { use FluentDOM\Xpath\Transformer as TransformerInterface; use PhpCss\Ast\Visitor\Xpath; class Transformer implements TransformerInterface { public function toXPath($selector, $isDocumentContext = FALSE, $isHtml = FALSE) { $options = $isDocumentContext ? Xpath::OPTIO...
<?php namespace FluentDOM\PhpCss { use FluentDOM\Xpath\Transformer as TransformerInterface; use PhpCss\Ast\Visitor\Xpath; class Transformer implements TransformerInterface { public function toXPath($selector, $isDocumentContext = FALSE, $isHtml = FALSE) { $options = $isDocumentContext ? Xpath::OPTIO...
Remove use statement not in use.
<?php namespace Respect\Validation\Rules; use Respect\Validation\Exceptions\ComponentException; abstract class AbstractRegexRule extends AbstractFilterRule { abstract protected function getPregFormat(); public function validateClean($input) { return preg_match($this->getPregFormat(), $input); ...
<?php namespace Respect\Validation\Rules; abstract class AbstractRegexRule extends AbstractFilterRule { abstract protected function getPregFormat(); public function validateClean($input) { return preg_match($this->getPregFormat(), $input); } }
Add exptected variable for test case
<?php namespace Odoo\Client\Test\Output; use Odoo\Client\Output\UrlOutput; class UrlOutputTest extends \PHPUnit_Framework_TestCase { public function testCreateUrl() { $urlOutput = new UrlOutput(); $host = 'test.example.com'; $port = 8069; $type = null; $output = $urlO...
<?php namespace Odoo\Client\Test\Output; use Odoo\Client\Output\UrlOutput; class UrlOutputTest extends \PHPUnit_Framework_TestCase { public function testCreateUrl() { $urlOutput = new UrlOutput(); $host = 'test.example.com'; $port = 8069; $type = null; $expected = 'tes...
Add STI for audit - fix migrations
<?php namespace Oro\Bundle\DataAuditBundle\Migrations\Schema\v1_6; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Type; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migration\OrderedMigrationInterface; use Oro\Bundle\MigrationBundle\Migration\QueryBag; class SetNotNul...
<?php namespace Oro\Bundle\DataAuditBundle\Migrations\Schema\v1_6; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Type; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migration\OrderedMigrationInterface; use Oro\Bundle\MigrationBundle\Migration\QueryBag; class SetNotNul...
Fix set null by default for ArrayCollection
<?php namespace LapaLabs\BlogBundle\Model; use Doctrine\Common\Collections\ArrayCollection; /** * Interface PostCategoryInterface */ interface PostCategoryInterface { /** * @return CategoryPostInterface[]|ArrayCollection */ public function getPosts(); /** * @param CategoryPostInterface[...
<?php namespace LapaLabs\BlogBundle\Model; use Doctrine\Common\Collections\ArrayCollection; /** * Interface PostCategoryInterface */ interface PostCategoryInterface { /** * @return CategoryPostInterface[]|ArrayCollection */ public function getPosts(); /** * @param CategoryPostInterface[...
Change to require_once so we dont have duplicate function errors.
<?php # tocsv.php - OSDial # # Copyright (C) 2010 Lott Caskey <lottcaskey@gmail.com> LICENSE: AGPLv3 # # This file is part of OSDial. # # OSDial is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software...
<?php # tocsv.php - OSDial # # Copyright (C) 2010 Lott Caskey <lottcaskey@gmail.com> LICENSE: AGPLv3 # # This file is part of OSDial. # # OSDial is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software...
Update database connection to 7.1
<?php class Connection { public function getDatabase() { $dbh = NULL; $host = "localhost"; $dbname = "test"; $username = "root"; $password = ""; try { $dbh = new PDO('mysql:host=' . $host . ';dbname=' . $dbname, $username, $password); $dbh->...
<?php class Connection { private const HOST = "LOCALHOST"; private const DATABASE = "..."; private const USERNAME = "..."; private const PASSWORD = "..."; public function getDatabase() { $dbh = NULL; try { $dbh = new PDO('mysql:host=' . SELF::HOST . ';dbname=' . SE...
Set event subscriber priority for failure events
<?php declare(strict_types=1); namespace Codeception\Subscriber; use Codeception\Event\TestEvent; use Codeception\Events; use Codeception\ResultAggregator; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class FailFast implements EventSubscriberInterface { use Shared\StaticEventsTrait; /** ...
<?php declare(strict_types=1); namespace Codeception\Subscriber; use Codeception\Event\TestEvent; use Codeception\Events; use Codeception\ResultAggregator; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class FailFast implements EventSubscriberInterface { use Shared\StaticEventsTrait; /** ...
Solve compatibility issues and more.
<?php readfile('template/header.php'); ?> <?php readfile('template/analytics.php'); ?> <div class="container"> <main role="main"> <div class="jumbotron txt-tc"> <h3 class="display-tc"><i class="fa fa-globe" aria-hidden="true"></i> Welcome to TechCavern!</h3> <p> A Free and Open-So...
<?php readfile('./template/header.php'); ?> <?php readfile('./template/analytics.php'); ?> <div class="container"> <main role="main"> <div class="jumbotron txt-tc"> <h3 class="display-tc"><i class="fa fa-globe" aria-hidden="true"></i> Welcome to TechCavern!</h3> <p> A Free and Ope...
Add annotation through IdeHelper run
<?php /** * @var RouteBuilder $routes */ use Cake\Routing\RouteBuilder; $routes->prefix('Admin', function (RouteBuilder $routes) { $routes->plugin('Queue', function (RouteBuilder $routes) { $routes->connect('/', ['controller' => 'Queue', 'action' => 'index']); $routes->fallbacks(); }); }); $routes->plugin('...
<?php /** * @var \Cake\Routing\RouteBuilder $routes */ use Cake\Routing\RouteBuilder; $routes->prefix('Admin', function (RouteBuilder $routes) { $routes->plugin('Queue', function (RouteBuilder $routes) { $routes->connect('/', ['controller' => 'Queue', 'action' => 'index']); $routes->fallbacks(); }); }); $ro...
Allow behaviors to be placed outside extensions.
<?php /** * Lithium: the most rad php framework * * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org) * @license http://opensource.org/licenses/bsd-license.php The BSD License */ use lithium\core\Libraries; /** * This adds the `'behavior'` type to the list of recognized class types. Yo...
<?php /** * Lithium: the most rad php framework * * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org) * @license http://opensource.org/licenses/bsd-license.php The BSD License */ use lithium\core\Libraries; /** * This adds the `'behavior'` type to the list of recognized class types. Yo...
Use the full path for code coverage.
#!/usr/bin/env php <?php chdir(__DIR__); $returnStatus = null; passthru('composer install --dev', $returnStatus); if ($returnStatus !== 0) { exit(1); } require 'vendor/autoload.php'; passthru('./vendor/bin/phpcs --standard=' . __DIR__ . '/vendor/dominionenterprises/dws-coding-standard/DWS -n src tests *.php', $r...
#!/usr/bin/env php <?php chdir(__DIR__); $returnStatus = null; passthru('composer install --dev', $returnStatus); if ($returnStatus !== 0) { exit(1); } require 'vendor/autoload.php'; passthru('./vendor/bin/phpcs --standard=' . __DIR__ . '/vendor/dominionenterprises/dws-coding-standard/DWS -n src tests *.php', $r...
Remove invalid test for Week period
<?php namespace DateRangerTest\Period; use DateRanger\Period\Week; final class WeekTest extends \PHPUnit_Framework_TestCase { /** @test */ public function validWeek() { $week = new Week(); $this->assertEquals(date('Y-m-W'), $week->start()->format('Y-m-W')); } /** @test */ pub...
<?php namespace DateRangerTest\Period; use DateRanger\Period\Week; final class WeekTest extends \PHPUnit_Framework_TestCase { /** @test */ public function getCorrectFirstDayWeek() { $week = new Week('2015-01-01'); $this->assertEquals(date('Y-m-d', strtotime('2014-12-29')), $week->start()-...
Make feedback form use smtphost too
<?php /** * Log the feedback information * The token can be traced to a student ID for feedback follow-up * The user agent can be used to debug front-end/visual bugs */ // We can send the user back to the page they were on once completed $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/'; if...
<?php /** * Log the feedback information * The token can be traced to a student ID for feedback follow-up * The user agent can be used to debug front-end/visual bugs */ // We can send the user back to the page they were on once completed $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/'; if...
Add attribute for 'contact' in person shortcode
<?php # Member template for the 'medlem' shortcode function # The $meta includes member info # Uses a $content variable if available, otherwise the meta description of the actual member. $year = $meta['it_year']; $description = ($content != null) ? $content : $meta['description']; $avatar_size = ($args != null...
<?php # Member template for the 'medlem' shortcode function # The $meta includes member info # Uses a $content variable if available, otherwise the meta description of the actual member. $year = $meta['it_year']; $userdata = get_userdata($id); $description = ($content != null) ? $content : $meta['description']...
Add tip about switching channel in toolbar
<?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\Channel\Context; /** * @author Kamil Kokot <kam...
<?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\Channel\Context; /** * @author Kamil Kokot <kam...
Check if the category name is set before using it.
<?php namespace Product\Model\Mapper; use Zend\Stdlib\Hydrator\ClassMethods; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * Description of ProductHydrator * * @author wangting */ class ProductHydrator extends ClassMethods { //put your code here pub...
<?php namespace Product\Model\Mapper; use Zend\Stdlib\Hydrator\ClassMethods; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * Description of ProductHydrator * * @author wangting */ class ProductHydrator extends ClassMethods { //put your code here pub...
Create Tasks on a tasklist
<?php namespace Rossedman\Teamwork; use Rossedman\Teamwork\Traits\RestfulTrait; class Tasklist extends AbstractObject { protected $wrapper = 'todo-list'; protected $endpoint = 'tasklists'; /** * GET /tasklists/{$id}.json * @return mixed */ public function find() { retur...
<?php namespace Rossedman\Teamwork; use Rossedman\Teamwork\Traits\RestfulTrait; class Tasklist extends AbstractObject { protected $wrapper = 'todo-list'; protected $endpoint = 'tasklists'; /** * GET /tasklists/{$id}.json * @return mixed */ public function find() { retur...
Update api adapt withErrors method
<?php namespace Nam\Commander\Exceptions; use Illuminate\Support\MessageBag; use RuntimeException; /** * Class CommandValidationException * * @author Nam Hoang Luu <nam@mbearvn.com> * @package Nam\Commander\Exceptions * */ class CommandValidationException extends RuntimeException { /** * @var Mess...
<?php namespace Nam\Commander\Exceptions; use Illuminate\Support\Contracts\MessageProviderInterface; use Illuminate\Support\MessageBag; use RuntimeException; /** * Class CommandValidationException * * @author Nam Hoang Luu <nam@mbearvn.com> * @package Nam\Commander\Exceptions * */ class CommandValidationExc...
Fix wrong order of parameters and change json decode to json encode
<?php namespace AppBundle\API\Edit; use AppBundle\API\Webservice; use AppBundle\AppBundle; use AppBundle\Entity\FennecUser; use AppBundle\Entity\WebuserData; use AppBundle\Service\DBVersion; use Symfony\Component\HttpFoundation\ParameterBag; class UpdateProject { private $manager; /** * UpdateProject ...
<?php namespace AppBundle\API\Edit; use AppBundle\API\Webservice; use AppBundle\AppBundle; use AppBundle\Entity\FennecUser; use AppBundle\Entity\WebuserData; use AppBundle\Service\DBVersion; use Symfony\Component\HttpFoundation\ParameterBag; class UpdateProject { private $manager; /** * UpdateProject ...
Rebuild generation of shortcodes araay
#!/usr/bin/env php <?php function normalizeShortcode($shortcode) { return str_replace('-', '_', strtolower($shortcode)); } $data = json_decode(file_get_contents(__DIR__ . '/../vendor/milesj/emojibase/packages/data/en/raw.json'), true); $emoji_array = require(__DIR__ . '/../src/shortcodes-array.php'); $existing_sh...
#!/usr/bin/env php <?php function normalizeShortcode($shortcode) { return str_replace('-', '_', strtolower($shortcode)); } $data = json_decode(file_get_contents(__DIR__ . '/../vendor/milesj/emojibase/packages/data/en/data.raw.json'), true); $shortcodes = json_decode(file_get_contents(__DIR__ . '/../vendor/milesj/...
Increase security loading the .env.testing file
<?php /* * This file is part of the Blackfire SDK package. * * (c) Blackfire <support@blackfire.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Blackfire\Bridge\Laravel; use Dotenv\Dotenv; use Illuminate\Contracts\...
<?php /* * This file is part of the Blackfire SDK package. * * (c) Blackfire <support@blackfire.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Blackfire\Bridge\Laravel; use Dotenv\Dotenv; use Illuminate\Contracts\...
Fix base path for file-like urls (i.e. thumbnails, file viewing/editing on backend UI, etc.) for built-in php server.
<?php /* * This could be loaded on a very old version of PHP so no syntax/methods over 5.2 in this file. */ use Bolt\Exception\BootException; if (version_compare(PHP_VERSION, '5.5.9', '<')) { require dirname(dirname(__FILE__)) . '/src/Exception/BootException.php'; BootException::earlyExceptionVersion(); } ...
<?php /* * This could be loaded on a very old version of PHP so no syntax/methods over 5.2 in this file. */ use Bolt\Exception\BootException; if (version_compare(PHP_VERSION, '5.5.9', '<')) { require dirname(dirname(__FILE__)) . '/src/Exception/BootException.php'; BootException::earlyExceptionVersion(); } ...
Add skip argument to `bulk:all`
<?php namespace App\Console\Commands\Bulk; use Aic\Hub\Foundation\AbstractCommand as BaseCommand; class BulkAll extends BaseCommand { protected $signature = 'bulk:all'; protected $description = "Reset database and import everything"; public function handle() { // Import all bulkable resour...
<?php namespace App\Console\Commands\Bulk; use Aic\Hub\Foundation\AbstractCommand as BaseCommand; class BulkAll extends BaseCommand { protected $signature = 'bulk:all {skip?}'; protected $description = "Reset database and import everything"; public function handle() { $shouldSkipTo = $this...
Allow for easier testing with sf 1.1
<?php // Autofind the first available app environment $sf_root_dir = realpath(dirname(__FILE__).'/../../../'); $apps_dir = glob($sf_root_dir.'/apps/*', GLOB_ONLYDIR); $app = substr($apps_dir[0], strrpos($apps_dir[0], DIRECTORY_SEPARATOR) + 1, strlen($apps_dir[0])); if (!$app) { throw ne...
<?php // Autofind the first available app environment $sf_root_dir = realpath(dirname(__FILE__).'/../../../'); $apps_dir = glob($sf_root_dir.'/apps/*', GLOB_ONLYDIR); $app = substr($apps_dir[0], strrpos($apps_dir[0], DIRECTORY_SEPARATOR) + 1, strlen($apps_dir[0])); if (!$app) { throw ne...
Fix php warnings on phpunit test failures.
<?php require __DIR__ . '/../vendor/autoload.php';
<?php require __DIR__ . '/../vendor/autoload.php'; // avoiding of Yii Framework class autoloader warnings spl_autoload_unregister(array('YiiBase','autoload')); spl_autoload_register(function ($classname) { @YiiBase::autoload($classname); });
Fix invalid class name, and implement abstract method.
<?php namespace R\Hive\Commands; use Illuminate\Console\GeneratorCommand; class MakeValidatorCommand extends GeneratorCommand { protected function getPath($name) { $name = str_replace($this->laravel->getNamespace(), '', $name); // Add the class type to the file name. return $this->la...
<?php namespace R\Hive\Commands; use Illuminate\Console\GeneratorCommand; class HiveGeneratorCommand extends GeneratorCommand { protected function getPath($name) { $name = str_replace($this->laravel->getNamespace(), '', $name); // Add the class type to the file name. return $this->la...
Remove obsolete reference to RouterInterface
<?php declare(strict_types=1); namespace Onion\Framework\Http\Middleware\Factory; use Onion\Framework\Router\Route; use Psr\Container\ContainerInterface; use Onion\Framework\Router\Interfaces\RouterInterface; use Onion\Framework\Dependency\Interfaces\FactoryInterface; use Onion\Framework\Http\Middleware\RequestHandler...
<?php declare(strict_types=1); namespace Onion\Framework\Http\Middleware\Factory; use Onion\Framework\Router\Route; use Psr\Container\ContainerInterface; use Onion\Framework\Dependency\Interfaces\FactoryInterface; use Onion\Framework\Http\Middleware\RequestHandler; class RequestHandlerFactory implements FactoryInterf...
Add type safety to the url parameters
<?php namespace Backend\Modules\ContentBlocks\Api; use Backend\Modules\ContentBlocks\Domain\ContentBlock\ContentBlock; use Backend\Modules\ContentBlocks\Domain\ContentBlock\ContentBlockRepository; use FOS\RestBundle\Controller\Annotations as Rest; use JMS\Serializer\SerializerInterface; use Symfony\Component\HttpFoun...
<?php namespace Backend\Modules\ContentBlocks\Api; use Backend\Modules\ContentBlocks\Domain\ContentBlock\ContentBlock; use Backend\Modules\ContentBlocks\Domain\ContentBlock\ContentBlockRepository; use FOS\RestBundle\Controller\Annotations as Rest; use JMS\Serializer\SerializerInterface; use Symfony\Component\HttpFoun...
Allow UnkonwRemoteEntityException to be thrown based on previous
<?php class EngineBlock_Corto_ProxyServer_UnknownRemoteEntityException extends EngineBlock_Corto_ProxyServer_Exception { protected $_entityId; public function __construct($entityId) { $this->_entityId = $entityId; $message = "Unknown remote entity with entityid '$entityId'"; parent...
<?php class EngineBlock_Corto_ProxyServer_UnknownRemoteEntityException extends EngineBlock_Corto_ProxyServer_Exception { /** * @var string */ protected $_entityId; /** * @param string $entityId * @param Exception|null $previous */ public function __construct($entityId,...
Add 'force' option to core autoload & activate artisan command calls
<?php declare(strict_types=1); namespace Cortex\Foundation\Console\Commands; use Illuminate\Console\Command; class CoreInstallCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'cortex:install {--f|force : Force the op...
<?php declare(strict_types=1); namespace Cortex\Foundation\Console\Commands; use Illuminate\Console\Command; class CoreInstallCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'cortex:install {--f|force : Force the op...
Make data URI in a separate method and remove some litter
<?php class Layout { private $cache; private function mime($path) { switch(pathinfo($path, PATHINFO_EXTENSION)) { case 'css': return 'text/css'; case 'png': return 'image/png'; case 'ttf': return 'application/x-font-ttf'; default: return (new finfo(FILEINFO_MIME_TYPE))->file($path); } ...
<?php class Layout { private $cache; private function mime($path) { switch(pathinfo($path, PATHINFO_EXTENSION)) { case 'css': return 'text/css'; case 'png': return 'image/png'; case 'ttf': return 'application/x-font-ttf'; default: return (new finfo(FILEINFO_MIME_TYPE))->file($path); } ...
Fix the issue with not generating slugs
<?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. */ namespace Sylius\Component\Core\Model; use Sylius\Component\Taxonomy\Model\Taxonomy as BaseTaxonomy; ...
<?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. */ namespace Sylius\Component\Core\Model; use Sylius\Component\Taxonomy\Model\Taxonomy as BaseTaxonomy; ...
Revert "delete un needed route"
<?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 ...
Update UUID type to BINARY(16)
<?php namespace Maghead\Schema\Column; use Maghead\Schema\DeclareColumn; use Maghead\Schema\DeclareSchema; class UUIDPrimaryKeyColumn extends DeclareColumn { /** * TODO: the best type for UUID in mysql is BINARY(36). */ public function __construct(DeclareSchema $schema, $name = 'uuid', $type = 'bin...
<?php namespace Maghead\Schema\Column; use Maghead\Schema\DeclareColumn; use Maghead\Schema\DeclareSchema; class UUIDPrimaryKeyColumn extends DeclareColumn { /** * BINARY(16) is the best column type for UUID. * * @see http://mysqlserverteam.com/storing-uuid-values-in-mysql-tables/ */ publ...
Add cURL exception handler to CM preview URL fetcher
<?php namespace App\Models; use App\DeviantArt; class Cutiemark extends AbstractFillable { /** @var int */ public $cmid, $ponyid; /** @var string */ public $facing, $favme, $preview, $preview_src; /** @var int */ public $favme_rotation; /** @param array|object */ public function __construct($iter = null){ ...
<?php namespace App\Models; use App\DeviantArt; use App\Exceptions\CURLRequestException; class Cutiemark extends AbstractFillable { /** @var int */ public $cmid, $ponyid; /** @var string */ public $facing, $favme, $preview, $preview_src; /** @var int */ public $favme_rotation; /** @param array|object */ publ...
Validate user exists before sending its info out
<?php $u = new User(); $ui = UserInfo::getByID($u->getUserID()); $userInfo = [ 'name' => $u->getUserName(), 'firstName' => $ui->getAttribute('first_name') ]; // Capture renderable areas ob_start(); (new GlobalArea('Left Header'))->display($c); $LeftHeader = ['Left Header' => ob_get_clean()]; ob_start(); (new Glo...
<?php $u = new User(); $ui = UserInfo::getByID($u->getUserID()); if ($u) { $userInfo = [ 'name' => $u->getUserName(), 'firstName' => $ui->getAttribute('first_name') ]; } // Capture renderable areas ob_start(); (new GlobalArea('Left Header'))->display($c); $LeftHeader = ['Left Header' => ob_get_clean...
Clean up the rest of repositories
<?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. */ namespace Sylius\Component\User\Repository; use Pagerfanta\PagerfantaInterface; use Sylius\Component\...
<?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. */ namespace Sylius\Component\User\Repository; use Pagerfanta\PagerfantaInterface; use Sylius\Component\...
Use real rancher instance for tests
<?php namespace Rancher\Tests; use Rancher\Client; class ClientTest extends \PHPUnit_Framework_TestCase { public function testGetClient() { $client = new Client(null, null, null); $this->assertInstanceOf("\\GuzzleHttp\\Client", $client->getClient()); } }
<?php namespace Rancher\Tests; use Rancher\Client; class ClientTest extends \PHPUnit_Framework_TestCase { public function testGetClient() { $client = new Client('http://127.0.0.1:8080/', null, null); $this->assertInstanceOf("\\GuzzleHttp\\Client", $client->getClient()); } }
Update content in default blocker page.
<?php use yii\helpers\Url; use yii\helpers\Html; /* @var $this yii\web\View */ ?> <div class="ishtar-default-index"> <h1><?= $this->context->action->uniqueId ?></h1> <?php if ($this->context->module->isAlphaLogin):?> <p><?= Html::a('Sign out', Url::toRoute(['/' . $this->context->module->id . '/gate...
<?php use yii\helpers\Url; use yii\helpers\Html; /* @var $this yii\web\View */ ?> <div class="ishtar-default-index"> <h1><?= $this->context->module->name ?> <?= $this->context->module->version ?></h1> <?php if ($this->context->module->isAlphaLogin):?> <p><?= Html::a('Sign out ', Url::toRoute(['/' ....
Fix exception when SSH key is not found
<?php namespace Platformsh\Cli\Command\SshKey; use Platformsh\Cli\Command\CommandBase; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class SshKeyDeleteCommand extends CommandBase { protected function co...
<?php namespace Platformsh\Cli\Command\SshKey; use Platformsh\Cli\Command\CommandBase; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class SshKeyDeleteCommand extends CommandBase { protected function co...
Change the order of execution of various commands
<?php namespace Rafni\LaravelToolkit\Console\Scaffolding; use Illuminate\Console\Command; class PackageBuilder extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'toolkit:package {name : Name of the service package in singular}...
<?php namespace Rafni\LaravelToolkit\Console\Scaffolding; use Illuminate\Console\Command; class PackageBuilder extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'toolkit:package {name : Name of the service package in singular}...
Load fixture in test setUp
<?php namespace Nmc\DynamicPageBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DefaultControllerTest extends WebTestCase { public function testIndex() { $client = static::createClient(array(),array('HTTP_HOST' => 'fmip.git')); $crawler = $client->request('...
<?php namespace Nmc\DynamicPageBundle\Tests\Controller; use Liip\FunctionalTestBundle\Test\WebTestCase; class DefaultControllerTest extends WebTestCase { public function setUp() { $classes = array( 'Nmc\DynamicPageBundle\DataFixtures\ORM\LoadWebsiteData', ); $this->loadFi...
Remove opt-in checkbox from sign in form.
{{ Form::label('first_name', 'First Name') }} {{ form_error('first_name', $errors) }} {{ Form::text('first_name', null, ['placeholder' => 'What\'s your name?']) }} {{ Form::label('birthdate', 'Birthdate') }} {{ form_error('birthdate', $errors) }} {{ Form::text('birthdate', null, ['placeholder' => 'MM/DD/Y...
{{ Form::label('first_name', 'First Name') }} {{ form_error('first_name', $errors) }} {{ Form::text('first_name', null, ['placeholder' => 'What\'s your name?']) }} {{ Form::label('birthdate', 'Birthdate') }} {{ form_error('birthdate', $errors) }} {{ Form::text('birthdate', null, ['placeholder' => 'MM/DD/Y...
Store the Etherpad API key as a secret.
<?php /** * Gets the pads * * @return Array the pads list */ function get_pads () { //TODO: move API key in config $url = "http://pad.wolfplex.be/api/1.2.1/listAllPads?apikey=U67yKTUDzz19fEHyrAuNN4zUnKxbOJZu"; $api_reply = json_decode(file_get_contents($url)); ...
<?php require '../_includes/SecurityData.php'; /** * Gets the pads * * @return Array the pads list */ function get_pads () { $key = SecurityData::getSecret('etherpad.api.key'); $url = "http://pad.wolfplex.be/api/1.2.1/listAllPads?apikey=" . $key; $api_reply = jso...
Revert "check multiple acheteurs popup formulaire validation parcellaire"
<?php class ParcellaireValidationForm extends acCouchdbObjectForm { public function configure() { if(!$this->getObject()->isPapier() && $this->getObject()->hasProduitWithMultipleAcheteur()) { $this->setWidget('autorisation_acheteur', new sfWidgetFormInputCheckbox()); $this->setVali...
<?php class ParcellaireValidationForm extends acCouchdbObjectForm { public function configure() { if(!$this->getObject()->isPapier()) { $this->setWidget('autorisation_acheteur', new sfWidgetFormInputCheckbox()); $this->setValidator('autorisation_acheteur', new sfValidatorBoolean())...
Remove static reference to make sure the code stays php 5.2.4 compatible
<?php defined('SYSTEM_PATH') or exit('No direct script access allowed'); class Config { public static $items = array(); public static function load() { $yaml = new sfYamlParser(); $app_config = $yaml->parse(file_get_contents(SYSTEM_PATH.'config.yml')); if ( file_exists( ...
<?php defined('SYSTEM_PATH') or exit('No direct script access allowed'); class Config { public static $items = array(); public static function load() { $yaml = new sfYamlParser(); $app_config = $yaml->parse(file_get_contents(SYSTEM_PATH.'config.yml')); if ( file_exists( ...
Fix Flashmessage return int instead of Message array
<?php namespace FMUP\FlashMessenger\Driver; use FMUP\FlashMessenger\DriverInterface; use FMUP\FlashMessenger\Message; /** * Description of Session * * @author sweffling */ class Session implements DriverInterface { private $session; /** * @return \FMUP\Session */ private f...
<?php namespace FMUP\FlashMessenger\Driver; use FMUP\FlashMessenger\DriverInterface; use FMUP\FlashMessenger\Message; /** * Description of Session * * @author sweffling */ class Session implements DriverInterface { private $session; /** * @return \FMUP\Session */ private f...
Update error class to have better default messages
<?php namespace GoPayWin\ApiClient\Exceptions; class Base extends \Exception { protected $_Configuration; public function __construct(\GoPayWin\ApiClient\Configuration $Configuration, $body, $message = "", $code = 0, \Exception $previous = NULL) { $this->_Configuration = $Configuration; $this->_body ...
<?php namespace GoPayWin\ApiClient\Exceptions; class Base extends \Exception { protected $_Configuration; public function __construct(\GoPayWin\ApiClient\Configuration $Configuration, $body, $message = "", $code = 0, \Exception $previous = NULL) { $this->_Configuration = $Configuration; $this->_body ...
Set sortMap as an optional param
<?php namespace Alchemy\Rest\Request; interface SortOptions { const SORT_ASC = 'asc'; const SORT_DESC = 'desc'; /** * @param array $sortMap * @return Sort[] */ public function getSorts(array $sortMap); }
<?php namespace Alchemy\Rest\Request; interface SortOptions { const SORT_ASC = 'asc'; const SORT_DESC = 'desc'; /** * @param array $sortMap * @return Sort[] */ public function getSorts(array $sortMap = array()); }
Fix bug that prevented images from being stored.
<?php namespace Nohex\Eix\Modules\Catalog\Model; use Nohex\Eix\Services\Data\Sources\ImageStore as DataSource; use Nohex\Eix\Modules\Catalog\Model\Image; /** * Representation of an image associated with a product. */ class ProductImage extends Image { const COLLECTION = 'products'; protected function getDe...
<?php namespace Nohex\Eix\Modules\Catalog\Model; use Nohex\Eix\Services\Data\Sources\ImageStore as DataSource; use Nohex\Eix\Modules\Catalog\Model\Image; /** * Representation of an image associated with a product. */ class ProductImage extends Image { const COLLECTION = 'products'; protected function getDe...
Add type hint on Exception contructor
<?php namespace Bauhaus\Container; use Interop\Container\Exception\ContainerException; abstract class ContainerItemException extends \Exception implements ContainerException { public function __construct($label) { parent::__construct(sprintf($this->messageTemplate(), $label)); } abstract pro...
<?php namespace Bauhaus\Container; use Interop\Container\Exception\ContainerException; abstract class ContainerItemException extends \Exception implements ContainerException { public function __construct(string $label) { parent::__construct(sprintf($this->messageTemplate(), $label)); } abstr...
Fix users access zone comment description
<? $access_zone = $sub0; if($access_zone) $zone = sql::row("ks_access_zones", compact('access_zone')); if($action == "zone_manage") try { $data = array( 'access_zone' => $_POST['access_zone'], 'access_zone_parent' => $_POST['access_zone_parent'], 'zone_descr' => rte_...
<? $access_zone = $sub0; if($access_zone) $zone = sql::row("ks_access_zones", compact('access_zone')); if($action == "zone_manage") try { $data = array( 'access_zone' => $_POST['access_zone'], 'access_zone_parent' => $_POST['access_zone_parent'], 'zone_descr' => $_PO...
Handle compatibility for symfony <= 2.5
<?php namespace JBen87\ParsleyBundle\Form\Extension; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * @author Benoit Jouhaud <bjouhaud@prestaconcept.net> */ class Pa...
<?php namespace JBen87\ParsleyBundle\Form\Extension; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * @author Benoit Jouhaud <bjouhaud@prestaconcept.net> */ class Pa...
Add path to theme attributes
<?php namespace Pingpong\Themes; use Illuminate\Filesystem\Filesystem; use Pingpong\Modules\Json; use Symfony\Component\Finder\Finder as SymfonyFinder; class Finder { /** * The symfony finder instance. * * @var SymfonyFinder */ protected $finder; /** * The constructor. * ...
<?php namespace Pingpong\Themes; use Illuminate\Filesystem\Filesystem; use Pingpong\Modules\Json; use Symfony\Component\Finder\Finder as SymfonyFinder; class Finder { /** * The symfony finder instance. * * @var SymfonyFinder */ protected $finder; /** * The constructor. * ...
Fix config key in ModuleOptions factory
<?php declare(strict_types=1); namespace Riskio\IdempotencyModule\Container; use Interop\Container\ContainerInterface; use Riskio\IdempotencyModule\ModuleOptions; class ModuleOptionsFactory { public function __invoke(ContainerInterface $container) : ModuleOptions { $options = $container->get('config'...
<?php declare(strict_types=1); namespace Riskio\IdempotencyModule\Container; use Interop\Container\ContainerInterface; use Riskio\IdempotencyModule\ModuleOptions; class ModuleOptionsFactory { public function __invoke(ContainerInterface $container) : ModuleOptions { $options = $container->get('config'...
Add abstract parse method to basetype
<?php namespace GetOptionKit\ValueType; abstract class BaseType { public function __construct() { // code... } /** * Test a value to see if it fit the type * * @param mixed $value */ abstract public function test($value); }
<?php namespace GetOptionKit\ValueType; abstract class BaseType { public function __construct() { // code... } /** * Test a value to see if it fit the type * * @param mixed $value */ abstract public function test($value); /** * Parse a string value into it's t...
Support earlier versions of laravel that don't have ControllerMiddlewareOptions
<?php namespace Silber\Bouncer\Middleware; use Illuminate\Routing\ControllerMiddlewareOptions; trait AuthorizesResources { /** * Authorize a resource action. * * @param string $name * @param string $model * @param array $options * @param \Illuminate\Http\Request $request ...
<?php namespace Silber\Bouncer\Middleware; use Illuminate\Routing\ControllerMiddlewareOptions; trait AuthorizesResources { /** * Authorize a resource action. * * @param string $name * @param string $model * @param array $options * @param \Illuminate\Http\Request $request ...
Remove irrelvant methods in the test model
<?php class MockJsonModel extends Illuminate\Database\Eloquent\Model { use \ModelJsonColumn\JsonColumnTrait; protected $json_columns; public function __construct(array $attributes = []) { static::$booted[get_class($this)] = true; parent::__construct($attributes); } public fun...
<?php class MockJsonModel extends Illuminate\Database\Eloquent\Model { use \ModelJsonColumn\JsonColumnTrait; protected $json_columns; public function __construct(array $attributes = []) { static::$booted[get_class($this)] = true; parent::__construct($attributes); } public fun...
Fix displaying legend for fieldset
<?php namespace Jasny\FormBuilder; /** * Representation of an HTML <fieldset>. * * @option legend <legend> of the fieldset */ class Fieldset extends Group { /** * @var string */ protected $tagname = 'fieldset'; /** * Class constructor. * * @param array $options Eleme...
<?php namespace Jasny\FormBuilder; /** * Representation of an HTML <fieldset>. * * @option legend <legend> of the fieldset */ class Fieldset extends Group { /** * @var string */ protected $tagname = 'fieldset'; /** * Class constructor. * * @param array $options Eleme...