Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Improve as per new generics. Add tests.
<?php /** * MIT License * For full license information, please view the LICENSE file that was distributed with this source code. */ namespace CodeSnifferTest\Spryker\Sniffs\Commenting; use CodeSnifferTest\TestCase; use Spryker\Sniffs\Commenting\DocBlockParamAllowDefaultValueSniff; class DocBlockParamAllowDefault...
<?php /** * MIT License * For full license information, please view the LICENSE file that was distributed with this source code. */ namespace CodeSnifferTest\Spryker\Sniffs\Commenting; use CodeSnifferTest\TestCase; use Spryker\Sniffs\Commenting\DocBlockParamAllowDefaultValueSniff; class DocBlockParamAllowDefault...
Fix path parsing when a bucket prefix is not specified
<?php namespace Jalle19\VagrantRegistryGenerator\Configuration; use Symfony\Component\Console\Input\InputInterface; /** * Class Parser * @package Jalle19\VagrantRegistryGenerator\Configuration */ class Parser { /** * @param InputInterface $input * * @return Configuration */ public sta...
<?php namespace Jalle19\VagrantRegistryGenerator\Configuration; use Symfony\Component\Console\Input\InputInterface; /** * Class Parser * @package Jalle19\VagrantRegistryGenerator\Configuration */ class Parser { /** * @param InputInterface $input * * @return Configuration */ public sta...
Substitute Date annotation with Field(type="date")
<?php namespace Gedmo\SoftDeleteable\Traits; use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** * SoftDeletable Trait, usable with PHP >= 5.4 * * @author Wesley van Opdorp <wesley.van.opdorp@freshheads.com> * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ trait SoftDeleteable...
<?php namespace Gedmo\SoftDeleteable\Traits; use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** * SoftDeletable Trait, usable with PHP >= 5.4 * * @author Wesley van Opdorp <wesley.van.opdorp@freshheads.com> * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ trait SoftDeleteable...
Fix httpdesc to work with new namespace
<?php /** * Throwable exceptions to return HTTP status code * * This list of Exception has be extracted from * here http://racksburg.com/choosing-an-http-status-code/ */ namespace Friendica\Network; use Exception; class HTTPException extends Exception { var $httpcode = 200; var $httpdesc = "";...
<?php /** * Throwable exceptions to return HTTP status code * * This list of Exception has be extracted from * here http://racksburg.com/choosing-an-http-status-code/ */ namespace Friendica\Network; use Exception; class HTTPException extends Exception { var $httpcode = 200; var $httpdesc = ""...
Add test case for basic file storage
<?php use Benrowe\Laravel\Config\Config; /** * Tests for Persisting Config class */ class StorageConfigTest extends PHPUnit_Framework_TestCase { public function testLoadData() { } public function testSaveData() { } public function testClearData() { } }
<?php use Benrowe\Laravel\Config\Config; use Benrowe\Laravel\Config\Storage\File; /** * Tests for Persisting Config class */ class StorageConfigTest extends PHPUnit_Framework_TestCase { private $sampleFile = 'assets/sample.json'; private $sampleWrite = 'assets/write.json'; public function setUp() {...
Move services. Defer validation provider.
<?php namespace Illuminate\Validation; use Illuminate\Support\ServiceProvider; use Illuminate\Contracts\Validation\ValidatesWhenResolved; class ValidationServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { ...
<?php namespace Illuminate\Validation; use Illuminate\Support\ServiceProvider; class ValidationServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true; /** * Register the service provider. * ...
Add the status list into a global variable.
<?php return [ 'adminEmail' => 'admin@example.com', 'resizeImage' => array('width'=>300, 'height'=>300), 'testGlobal' => 'aaaa', ];
<?php return [ 'adminEmail' => 'admin@example.com', 'resizeImage' => array('width'=>300, 'height'=>300), 'status' => array('A'=>'Active', 'I'=>'Inavtive'), ];
Check for subclasses of ElementpageExtension as well
<?php /** * @package elemental */ class ElementalArea extends WidgetArea { public function Elements() { $result = $this->getComponents('Widgets'); $list = new HasManyList('BaseElement', $result->getForeignKey()); $list->setDataModel($this->model); $list->sort('Sort ASC'); $list = $list->forForeignID(...
<?php /** * @package elemental */ class ElementalArea extends WidgetArea { public function Elements() { $result = $this->getComponents('Widgets'); $list = new HasManyList('BaseElement', $result->getForeignKey()); $list->setDataModel($this->model); $list->sort('Sort ASC'); $list = $list->forForeignID($t...
Remove direction filters for off-canvas
<?php /** * Template part for off canvas menu * * @package WordPress * @subpackage FoundationPress * @since FoundationPress 1.0.0 */ ?> <nav class="vertical menu off-canvas position-left" id="offCanvasleft" data-off-canvas data-position="left" data-accordion-menu role="navigation"> <?php foundationpress_mobil...
<?php /** * Template part for off canvas menu * * @package WordPress * @subpackage FoundationPress * @since FoundationPress 1.0.0 */ ?> <nav class="vertical menu off-canvas position-left" id="offCanvasleft" data-off-canvas data-position="left" data-accordion-menu role="navigation"> <?php foundationpress_mobil...
Add limit to history in user profile
<?php namespace Page; class User { public function index() { $this->router->redirect('user/profile'); } public function profile() { $this->load->model('Manga'); $this->load->library('Image'); $this->load->library('Date...
<?php namespace Page; class User { public function index() { $this->router->redirect('user/profile'); } public function profile() { $this->load->model('Manga'); $this->load->library('Image'); $this->load->library('Date...
Remove Telescope service provider registration
<?php namespace RadDB\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; use Laravel\Dusk\DuskServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void ...
<?php namespace RadDB\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; use Laravel\Dusk\DuskServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void ...
Use `base_path` instead of `config_path`
<?php namespace Wnx\LaravelStats; use Illuminate\Support\ServiceProvider; class StatsServiceProvider extends ServiceProvider { public function boot() { if ($this->app->runningInConsole()) { $this->publishes([ __DIR__.'/../config/stats.php' => config_path('stats.php'), ...
<?php namespace Wnx\LaravelStats; use Illuminate\Support\ServiceProvider; class StatsServiceProvider extends ServiceProvider { /** * @var string */ private $config = __DIR__.'/../config/stats.php'; /** * Bootstrap the application events. * * @return void */ public funct...
Revert "BAP-2304: OroConfig work only for tree named by prefix "oro_""
<?php namespace Oro\Bundle\ConfigBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\Config\Definition\Processor; class ConfigPass implements CompilerPassInterface { public...
<?php namespace Oro\Bundle\ConfigBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\Config\Definition\Processor; class ConfigPass implements CompilerPassInterface { public...
Add title to the page
<!doctype html> <html lang="fr"> <head></head> <body></body> </html>
<!doctype html> <html lang="fr"> <head> <title>Anis &amp; Flo, Octobre 2016</title> </head> <body></body> </html>
Use newer Message Broker publish method.
<?php namespace VotingApp\Services; use MessageBroker as MessageBrokerConnection; class MessageBroker { /** * Serialize and send payload to the Message Broker using a * given routing key. * * @param array $payload * @param string $routingKey */ public function publishRaw($payloa...
<?php namespace VotingApp\Services; use MessageBroker as MessageBrokerConnection; class MessageBroker { /** * Serialize and send payload to the Message Broker using a * given routing key. * * @param array $payload * @param string $routingKey */ public function publishRaw($payloa...
Update match result on score properties changes
<?php namespace App\Observers; use App\Events\MatchWasFinished; use App\Models\Match; use Illuminate\Support\Facades\Log; class MatchObserver { public function updating(Match $model) { $dirtyStatus = array_get($model->getDirty(), 'status'); $resultType = array_get($model->getOriginal(), 'resu...
<?php namespace App\Observers; use App\Events\MatchWasFinished; use App\Models\Match; use Illuminate\Support\Facades\Log; class MatchObserver { public function updating(Match $model) { $dirtyStatus = array_get($model->getDirty(), 'status'); $resultType = array_get($model->getOriginal(), 'resu...
Use same format for functions
<?php /** * WidgetController.php * avanzu-admin * Date: 16.03.14 */ namespace Avanzu\AdminThemeBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class WidgetController extends Controller { public function defaultBoxAction() { } public function solidBoxAction() {} publ...
<?php /** * WidgetController.php * avanzu-admin * Date: 16.03.14 */ namespace Avanzu\AdminThemeBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class WidgetController extends Controller { public function defaultBoxAction() {} public function solidBoxAction() {} public fu...
Use exception renderable instead of uses of instanceof
<?php namespace App\Exceptions; use App\Exceptions\SolverException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Routing\Exceptions\InvalidSignatureException; use Illuminate\Validation\ValidationException; use Throwable; class Handler extends ExceptionHandler { /** * A li...
<?php namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Routing\Exceptions\InvalidSignatureException; use Illuminate\Validation\ValidationException; use Throwable; class Handler extends ExceptionHandler { /** * A list of the exception types that are n...
Remove basic auth and legacy from unsubscribe builder
<?php namespace WebHooker; class UnsubscribeBuilder { /** * @var ApiClient */ private $client; private $subscriberId; private $tenant; private $events; private $basicAuth; private $legacy = []; public function __construct(ApiClient $client, $subscriberId, $tenant, $even...
<?php namespace WebHooker; class UnsubscribeBuilder { /** * @var ApiClient */ private $client; private $subscriberId; private $tenant; private $events = []; public function __construct(ApiClient $client, $subscriberId, $tenant, $events = []) { $this->client = $client;...
Return a 503 on test config delete if in maintenance mode
<?php namespace SimplyTestable\ApiBundle\Controller\JobConfiguration; use SimplyTestable\ApiBundle\Services\ScheduledJob\Service as ScheduledJobService; class DeleteController extends JobConfigurationController { public function deleteAction($label) { $label = trim($label); $this->getJobConfigu...
<?php namespace SimplyTestable\ApiBundle\Controller\JobConfiguration; use SimplyTestable\ApiBundle\Services\ScheduledJob\Service as ScheduledJobService; class DeleteController extends JobConfigurationController { public function deleteAction($label) { if ($this->getApplicationStateService()->isInMainten...
Add scalar typehints/return types on final/internal/private code
<?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\Validator; use Symfony\Component\Validator\Validator\...
<?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\Validator; use Symfony\Component\Validator\Validator\...
Remove stuff that is for next version
<?php // Warning: pref names have a limit of 40 characters // Please prefix with ta_ (short for tikiaddon) and your package vendor and name function prefs_ta_synergiq_events_list() { return array( 'ta_synergiq_events_on' => array( // This main _on pref is mandatory 'name' => tra('Activate Synergiq Event Calenda...
<?php // Warning: pref names have a limit of 40 characters // Please prefix with ta_ (short for tikiaddon) and your package vendor and name function prefs_ta_synergiq_events_list() { return array( 'ta_synergiq_events_on' => array( // This main _on pref is mandatory 'name' => tra('Activate Synergiq Event Calenda...
Use __CLASS__ for option name
<?php abstract class CM_Provision_Script_OptionBased extends CM_Provision_Script_Abstract implements CM_Typed { use CM_Provision_Script_IsLoadedTrait; /** * @param bool $loaded */ protected function _setLoaded($loaded) { CM_Option::getInstance()->set($this->_getOptionName(), (bool) $loa...
<?php abstract class CM_Provision_Script_OptionBased extends CM_Provision_Script_Abstract implements CM_Typed { use CM_Provision_Script_IsLoadedTrait; /** * @param bool $loaded */ protected function _setLoaded($loaded) { CM_Option::getInstance()->set($this->_getOptionName(), (bool) $loa...
Fix chaining of initialise method
<?php namespace Harp\Timestamps; use Harp\Harp\AbstractModel; /** * @author Ivan Kerin <ikerin@gmail.com> * @copyright 2014, Clippings Ltd. * @license http://spdx.org/licenses/BSD-3-Clause */ trait TimestampsRepoTrait { public function getCurrentDate() { return date('Y-m-d H:i:s'); } ...
<?php namespace Harp\Timestamps; use Harp\Harp\AbstractModel; /** * @author Ivan Kerin <ikerin@gmail.com> * @copyright 2014, Clippings Ltd. * @license http://spdx.org/licenses/BSD-3-Clause */ trait TimestampsRepoTrait { public function getCurrentDate() { return date('Y-m-d H:i:s'); } ...
Remove flex helper from fromt page callouts
<?php $i = 0; $callouts = get_field("callouts"); ?> <?php if ($callouts): ?> <?php while (have_rows("callouts")): ?> <?php the_row(); ?> <?php $title = get_sub_field("title"); $content = get_sub_field("content"); ?> <?php if ($title || $content): ?> <?p...
<?php $i = 0; $callouts = get_field("callouts"); ?> <?php if ($callouts): ?> <?php while (have_rows("callouts")): ?> <?php the_row(); ?> <?php $title = get_sub_field("title"); $content = get_sub_field("content"); ?> <?php if ($title || $content): ?> <?p...
Update method should use KConfig instead of ArrayObject as parameter.
<?php /** * @version $Id$ * @category Koowa * @package Koowa_Pattern * @subpackage Observer * @copyright Copyright (C) 2007 - 2010 Johan Janssens and Mathias Verraes. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://www.koowa.org */...
<?php /** * @version $Id$ * @category Koowa * @package Koowa_Pattern * @subpackage Observer * @copyright Copyright (C) 2007 - 2010 Johan Janssens and Mathias Verraes. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://www.koowa.org */...
Fix 0 coming out as empty cell
<?php namespace AM2Studio\Laravel\Exporter; trait Exporter { public function exportOneSheet($collection, array $columns, $title, $filename, $format = 'xls', $creator = '', $company = '') { $rows = []; $rows[] = array_values($columns); foreach ($collection as $item) { $row ...
<?php namespace AM2Studio\Laravel\Exporter; trait Exporter { public function exportOneSheet($collection, array $columns, $title, $filename, $format = 'xls', $creator = '', $company = '') { $rows = []; $rows[] = array_values($columns); foreach ($collection as $item) { $row ...
Set fetch mode to associative array by default
<?php namespace UoMCS\OpenBadges\Backend; class SQLite { private static $instance = null; public static function getInstance() { if (self::$instance === null) { self::$instance = new \PDO(OPEN_BADGES_DB_DSN); self::$instance->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); ...
<?php namespace UoMCS\OpenBadges\Backend; class SQLite { private static $instance = null; public static function getInstance() { if (self::$instance === null) { self::$instance = new \PDO(OPEN_BADGES_DB_DSN); self::$instance->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); ...
Use Case for persona b (pet seeker)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Pet Foster ABQ - Persona-B</title> <style></style> </head> <body> <h1>Pet Foster ABQ</h1> <p>It is 6:05 p.m. and Chloe is using her families desk top to search for a site that will help her locate placement for the dog. As she only has...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Pet Foster ABQ - Persona-B</title> <style></style> </head> <body> <h1>Pet Foster ABQ</h1> <p>It is 6:05 p.m. and Chloe, with the help of her father, is using her families desk top to search for a site that will help her locate placemen...
Add function to get stats
<?php namespace OrgManager\ApiClient; use GuzzleHttp\Client; class OrgManager { /** @var \GuzzleHttp\Client */ protected $client; /** @var string */ protected $baseUrl; /** * @param \GuzzleHttp\Client $client * @param string $apiToken * @param string $root...
<?php namespace OrgManager\ApiClient; use GuzzleHttp\Client; class OrgManager { /** @var \GuzzleHttp\Client */ protected $client; /** @var string */ protected $baseUrl; /** * @param \GuzzleHttp\Client $client * @param string $apiToken * @param string $root...
Add proper types seeds and reseed
<?php use Illuminate\Database\Seeder; class TypeSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { DB::table('types')->insert([ 'contentType' => 'TEST', 'expectedFields' => ' "TestField1" => "true"...
<?php use Illuminate\Database\Seeder; class TypeSeeder extends Seeder { /** * Run the database seeds. * * For expected fields, hstore specify as follows * "Field Name" => "length of field (Short, medium, long, box), * required field (true,false), lock display on for...
Make email validation a bit stricter again
<?php class EmailValidator { private $model; public function __construct ($model) { $this->model = $model; } public function validate ($property, $rules) { if (!empty($this->model->$property)) { if (preg_match('/^\A[^\s@]+@[^\s.@][^\s@]*\.[^\s@]+$/ui', $this->model->$property) != 1) { return array('ema...
<?php class EmailValidator { private $model; public function __construct ($model) { $this->model = $model; } public function validate ($property, $rules) { if (!empty($this->model->$property)) { if (preg_match('/^\A[^\s"(),:;<>\[\]\\\@]+@[^\s.@][^\s@]*\.[^\s@]+$/ui', $this->model->$property) != 1) { re...
Fix compatibility issues with anonymous classes in bundle
<?php declare(strict_types=1); namespace Becklyn\RouteTreeBundle; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component...
<?php declare(strict_types=1); namespace Becklyn\RouteTreeBundle; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component...
Make the translate entity abstract
<?php namespace ContentTranslator\Entity; class Translate { protected $lang; protected $db; public function __construct() { global $wpdb; $this->db = $wpdb; $this->lang = \ContentTranslator\Switcher::$currentLanguage->code; } /** * Creates a language specific met...
<?php namespace ContentTranslator\Entity; abstract class Translate { protected $lang; protected $db; public function __construct() { global $wpdb; $this->db = $wpdb; $this->lang = \ContentTranslator\Switcher::$currentLanguage->code; } /** * Creates a language spe...
Add 'guarded' to allow for mass assignment via Eloquent; Add User and DuesTransaction Eloquent relationships
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Payment extends Model { // }
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Payment extends Model { /** * The attributes that aren't mass assignable. * * @var array */ protected $guarded = ['id']; /** * Get the User associated with the Payment model. */ public function user() ...
Fix Fixtures to work with settings overhaul.
<?php namespace App\Entity\Fixture; use App\Entity; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Persistence\ObjectManager; class Settings extends AbstractFixture { public function load(ObjectManager $em): void { $settings = new Entity\Settings(); $settings->setBaseUrl(gete...
<?php namespace App\Entity\Fixture; use App\Entity; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Persistence\ObjectManager; class Settings extends AbstractFixture { public function load(ObjectManager $em): void { $settings = [ 'baseUrl' => getenv('INIT_BASE_URL') ?? 'doc...
Set default timezone to avoid tripping up hhvm
<?php function includeIfExists($file) { if (file_exists($file)) { return include $file; } } if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) { echo 'You must set up the project dependencies, run the following com...
<?php function includeIfExists($file) { if (file_exists($file)) { return include $file; } } date_default_timezone_set('UTC'); if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) { echo 'You must set up the project ...
Update sample web page now that Events table has been renamed to UserRegionEvents
<html> <head></head> <body> <?php $conn = mysql_connect("localhost", "root", "passw0rd"); mysql_select_db("eventrecorder", $conn); $res = mysql_query("select * from Events", $conn); # print_r($count); echo "<h1>Summary</h1>\n"; echo "Got " . mysql_num_rows($res) . " events.\n"; $res = mysql_query("select UserName...
<html> <head></head> <body> <?php $conn = mysql_connect("localhost", "root", "passw0rd"); mysql_select_db("eventrecorder", $conn); $res = mysql_query("select * from UserRegionEvents", $conn); # print_r($count); echo "<h1>Summary</h1>\n"; echo "Got " . mysql_num_rows($res) . " events.\n"; $res = mysql_query("selec...
Adjust EmailType form type to use email templates selector - update unit tests
<?php namespace Oro\Bundle\EmailBundle\Tests\Unit\Form\Model; use Symfony\Component\PropertyAccess\PropertyAccess; use Oro\Bundle\EmailBundle\Form\Model\Email; class EmailTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider propertiesDataProvider * @param string $property * @param mixed...
<?php namespace Oro\Bundle\EmailBundle\Tests\Unit\Form\Model; use Oro\Bundle\EmailBundle\Entity\EmailTemplate; use Symfony\Component\PropertyAccess\PropertyAccess; use Oro\Bundle\EmailBundle\Form\Model\Email; class EmailTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider propertiesDataProvider ...
Add one more function in order to save all changes which are done with the user manager
<?php namespace AppBundle\Controller; use EasyCorp\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController; class AdminController extends BaseAdminController { public function createNewFennecUserEntity(){ return $this->get('fos_user.user_manager')->createUser(); } public functi...
<?php namespace AppBundle\Controller; use EasyCorp\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController; class AdminController extends BaseAdminController { public function createNewFennecUserEntity(){ return $this->get('fos_user.user_manager')->createUser(); } public functi...
Format expected checkin as Y-m-d in form
<!-- Purchase Date --> <div class="form-group {{ $errors->has('purchase_date') ? ' has-error' : '' }}"> <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label> <div class="input-group col-md-3"> <div class="input-group date" data-provide="datepicker" data-dat...
<!-- Purchase Date --> <div class="form-group {{ $errors->has('purchase_date') ? ' has-error' : '' }}"> <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label> <div class="input-group col-md-3"> <div class="input-group date" data-provide="datepicker" data-dat...
Update SuiteCRM Version to 7.4.2.
<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); $suitecrm_version = '7.4.1'; $suitecrm_timestamp = '2015-11-10 18:00pm';
<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); $suitecrm_version = '7.4.2'; $suitecrm_timestamp = '2015-11-17 18:00pm';
Hide back to top link from screen readers
<?php /** * Template for displaying the footer * * Description for template. * * @Author: Roni Laukkarinen * @Date: 2020-05-11 13:33:49 * @Last Modified by: Roni Laukkarinen * @Last Modified time: 2020-05-11 13:33:49 * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * ...
<?php /** * Template for displaying the footer * * Description for template. * * @Author: Roni Laukkarinen * @Date: 2020-05-11 13:33:49 * @Last Modified by: Roni Laukkarinen * @Last Modified time: 2020-05-11 13:33:49 * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * ...
Validate UK phone numbers correctly.
<?php namespace VotingApp\Providers; use Illuminate\Support\ServiceProvider; class ValidationServiceProvider extends ServiceProvider { /** * The validator instance * * @var \Illuminate\Validation\Factory */ protected $validator; /** * Bootstrap the application services. * * @retur...
<?php namespace VotingApp\Providers; use Illuminate\Support\ServiceProvider; class ValidationServiceProvider extends ServiceProvider { /** * The validator instance * * @var \Illuminate\Validation\Factory */ protected $validator; /** * Bootstrap the application services. * * @retur...
Remove deprecated parameter size in UploadedFile constructor call.
<?php namespace Vanio\DomainBundle\Model; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\File as SymfonyFile; use Symfony\Component\HttpFoundation\File\UploadedFile; class FileToUpload extends UploadedFile { /** @var bool */ private $temporary = false; public funct...
<?php namespace Vanio\DomainBundle\Model; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\File as SymfonyFile; use Symfony\Component\HttpFoundation\File\UploadedFile; class FileToUpload extends UploadedFile { /** @var bool */ private $temporary = false; public funct...
Remove extra parenthesis on subscribe page
@extends('layout.master') @section('title', trans('cachet.subscriber.subscribe'). " | ". $siteTitle)) @section('description', trans('cachet.meta.description.subscribe', ['app' => $siteTitle])) @section('content') <div class="pull-right"> <p><a class="btn btn-success btn-outline" href="{{ cachet_route('status-pa...
@extends('layout.master') @section('title', trans('cachet.subscriber.subscribe'). " | ". $siteTitle) @section('description', trans('cachet.meta.description.subscribe', ['app' => $siteTitle])) @section('content') <div class="pull-right"> <p><a class="btn btn-success btn-outline" href="{{ cachet_route('status-pag...
Update imagick demos to be correct.
<?php declare(strict_types=1); namespace BaseReality\Service; class DeploySiteNotifier { public static $knownFullnames = [ // "Danack/BaseReality", "Danack/Blog", "Danack/docs", "Danack/example", "Danack/Imagick-demos", "Danack/OpenSourceFees", "Danack/Tier...
<?php declare(strict_types=1); namespace BaseReality\Service; class DeploySiteNotifier { public static $knownFullnames = [ // "Danack/BaseReality", "Danack/Blog", "Danack/docs", "Danack/example", // "Danack/Imagick-demos", "Imagick/ImagickDemos", "Danack/Ope...
Move configuration to Bundle Extension.
<?php namespace Clastic\MenuBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader; /** * This is the class that loads and manag...
<?php namespace Clastic\MenuBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Compo...
Set all older tracks to be "visible".
<?php declare(strict_types=1); namespace App\Entity\Migration; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; final class Version20220706235608 extends AbstractMigration { public function getDescription(): string { return 'Add "is_visible" denormalization to song_history...
<?php declare(strict_types=1); namespace App\Entity\Migration; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; final class Version20220706235608 extends AbstractMigration { public function getDescription(): string { return 'Add "is_visible" denormalization to song_history...
Fix compatibility with Symfony 4.2
<?php declare(strict_types=1); namespace Arachne\Forms\Extension\Application\Type; use Arachne\Forms\Extension\Application\ApplicationRequestHandler; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\Extension\Core\Type\FormType; use Symfony\Component\Form\FormBuilderInterface; /** * @au...
<?php declare(strict_types=1); namespace Arachne\Forms\Extension\Application\Type; use Arachne\Forms\Extension\Application\ApplicationRequestHandler; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\Extension\Core\Type\FormType; use Symfony\Component\Form\FormBuilderInterface; /** * @au...
Fix bug when saving users in mailing list
<?php // fetch email addresses and remove duplicates $emails = Lista::remove_duplicates_from($_POST['email_addresses']); /* Saves users in the list. * @param $list_id the ID of the mailing list you want to save the users to. * @param $emails an array of unique emails. * */ foreach ($emails as $email) { i...
<?php // fetch email addresses and remove duplicates $emails = Lista::remove_duplicates_from($_POST['email_addresses']); /* Saves users in the list. * @param $list_id the ID of the mailing list you want to save the users to. * @param $emails an array of unique emails. */ foreach ($emails as $email) { $_...
Use mocked Authenticator instead of an instance of EMailAuthenticator to prevent problems with other ojects used by the latter
<?php /** * Definition of AuthServiceTestBase.php * * @copyright 2015-today Justso GmbH * @author j.schirrmacher@justso.de */ namespace justso\justauth; use justso\justapi\testutil\ServiceTestBase; use justso\justapi\testutil\TestEnvironment; /** * Class AuthServiceTestBase */ class AuthServiceTestBase e...
<?php /** * Definition of AuthServiceTestBase.php * * @copyright 2015-today Justso GmbH * @author j.schirrmacher@justso.de */ namespace justso\justauth; use justso\justapi\testutil\ServiceTestBase; use justso\justapi\testutil\TestEnvironment; /** * Class AuthServiceTestBase */ class AuthServiceTestBase e...
Fix the acceptance tests sine we have a fancy new appmenu!
<?php /** * Gallery * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Olivier Paroz <galleryapps@oparoz.com> * * @copyright Olivier Paroz 2016 */ use \Page\Acceptance\Login; use \Page\Gallery as GalleryPage; $I = new AcceptanceTester($sc...
<?php /** * Gallery * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Olivier Paroz <galleryapps@oparoz.com> * * @copyright Olivier Paroz 2016 */ use \Page\Acceptance\Login; use \Page\Gallery as GalleryPage; $I = new AcceptanceTester($sc...
Fix a nasty nasty namespace bug
<?php namespace Wisembly\Behat\Extension\Initializer; use Behat\Behat\Context\Context; use Behat\Behat\Context\Initializer\ContextInitializer; use Wisembly\Behat\Extension\Tools\Debug; use Wisembly\Behat\Extension\Context\WizInterface; /** * Initializes wiz contexts (which should be implemented by all contexts) * ...
<?php namespace Wisembly\Behat\Extension\Initializer; use Behat\Behat\Context\Context; use Behat\Behat\Context\Initializer\ContextInitializer; use Wisembly\Behat\Extension\Tools\Debug; use Wisembly\Behat\Extension\Context\WizInterface; /** * Initializes wiz contexts (which should be implemented by all contexts) * ...
Add a big, fat warning message that scrap will delete the entire folder.
<?php namespace Studio\Console; use Studio\Package; use Studio\Config\Config; use Studio\Shell\Shell; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Filesystem\Filesystem; class ScrapCommand extends BaseCommand { protected $config; public function __construct(Config $config) ...
<?php namespace Studio\Console; use Studio\Package; use Studio\Config\Config; use Studio\Shell\Shell; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Filesystem\Filesystem; class ScrapCommand extends BaseCommand { protected $config; public function __construct(Config $config) ...
Test register with existing email
<?php namespace Tests\Feature; use Tests\TestCase; class RegisterTest extends TestCase { /** @test */ public function can_register() { $this->postJson('/api/register', [ 'name' => 'Test User', 'email' => 'test@test.app', 'password' => 'secret', 'pas...
<?php namespace Tests\Feature; use Tests\TestCase; use App\User; class RegisterTest extends TestCase { /** @test */ public function can_register() { $this->postJson('/api/register', [ 'name' => 'Test User', 'email' => 'test@test.app', 'password' => 'secret', ...
Change bower alias to bower-asset
<?php // comment out the following two lines when deployed to production defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_ENV') or define('YII_ENV', 'dev'); require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.p...
<?php // comment out the following two lines when deployed to production defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_ENV') or define('YII_ENV', 'dev'); require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); \Yii::setAlias('@bower', '/../vendor/bower-as...
Remove test that does not probe anything
<?php namespace CfdiUtilsTests\OpenSSL; use CfdiUtils\OpenSSL\OpenSSL; use CfdiUtils\OpenSSL\OpenSSLPropertyTrait; use CfdiUtilsTests\TestCase; final class OpenSSLPropertyTest extends TestCase { public function testCorrectImplementer() { $object = new class() { use OpenSSLPropertyTrait; ...
<?php namespace CfdiUtilsTests\OpenSSL; use CfdiUtils\OpenSSL\OpenSSL; use CfdiUtils\OpenSSL\OpenSSLPropertyTrait; use CfdiUtilsTests\TestCase; final class OpenSSLPropertyTest extends TestCase { public function testCorrectImplementer() { $object = new class() { use OpenSSLPropertyTrait; ...
Make sure $_SERVER['HTTP_HOST'] is defined
<?php namespace Systemblast\Engine\Http; class Request { private static $instance = null; public static function make() { // Check if instance is already exists if (self::$instance == null) { self::$instance = (new Request())->create(); } return self::$instance;...
<?php namespace Systemblast\Engine\Http; class Request { private static $instance = null; public static function make() { // Check if instance is already exists if (self::$instance == null) { self::$instance = (new Request())->create(); } return self::$instance;...
Fix for zf3 factory interface
<?php namespace ZfcUserList\Controller\Factory; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use ZfcUserList\Controller\UserListController; class UserListController implements FactoryInterface { public function createService(ServiceLocatorInterface $sm) { ...
<?php namespace ZfcUserList\Controller\Factory; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use ZfcUserList\Controller\UserListController as controller; use Interop\Container\ContainerInterface; class UserListController implements FactoryInterface { public function c...
Add Context to the generated path
<?php /* * This file is part of the Sonata project. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\MediaBundle\Generator; use Sonata\MediaBundle\Model\Med...
<?php /* * This file is part of the Sonata project. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\MediaBundle\Generator; use Sonata\MediaBundle\Model\Med...
Add delete method to source data cache interface.
<?php /* * This file is part of the Tadcka package. * * (c) Tadas Gliaubicas <tadcka89@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tadcka\Mapper\Cache; use Tadcka\Mapper\Source\Data\SourceDataInterface; ...
<?php /* * This file is part of the Tadcka package. * * (c) Tadas Gliaubicas <tadcka89@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tadcka\Mapper\Cache; use Tadcka\Mapper\Source\Data\SourceDataInterface; ...
Add missing options parameter to Singleton::get_instance()
<?php namespace Nectary; /** * Support singletons in PHP */ abstract class Singleton { protected static $instances = array(); protected function __construct() {} protected function __clone() {} public static function get_instance() { $cls = get_called_class(); // late-static-bound class name if ( !...
<?php namespace Nectary; /** * Support singletons in PHP */ abstract class Singleton { protected static $instances = array(); protected function __construct() {} protected function __clone() {} public static function get_instance( $options = array() ) { $cls = get_called_class(); // late-static-bound c...
Fix Germany's number cleaner to correctly support the trunk number '0'
<?php if (!defined('CALLERID')) { // This check helps protect against security problems; // your code file can't be executed directly from the web. exit(1); } class DeNumberCleaner extends NumberCleaner { public $international_calling_prefix = '00'; function clean_number($number){ if(preg...
<?php if (!defined('CALLERID')) { // This check helps protect against security problems; // your code file can't be executed directly from the web. exit(1); } class DeNumberCleaner extends NumberCleaner { public $international_calling_prefix = '00'; function clean_number($number){ if(preg...
Fix driver class name casing
<?php /* * This file is part of NotifyMe. * * (c) Joseph Cohen <joseph.cohen@dinkbit.com> * (c) Graham Campbell <graham@mineuk.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace NotifyMeHQ\NotifyMe; use InvalidArgum...
<?php /* * This file is part of NotifyMe. * * (c) Joseph Cohen <joseph.cohen@dinkbit.com> * (c) Graham Campbell <graham@mineuk.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace NotifyMeHQ\NotifyMe; use InvalidArgum...
Add Test case with delete Feature
<?php namespace Page; /** * Class TasksPage * @package Page */ class ApiPage { const URL = 'http://localhost:8000/task'; /** * * @param \AcceptanceTester $I Codeception variable */ public function __construct(\AcceptanceTester $I) { $this->tester = $I; } /** * F...
<?php namespace Page; /** * Class TasksPage * @package Page */ class ApiPage { const URL = 'http://localhost:8080/task'; /** * * @param \AcceptanceTester $I Codeception variable */ public function __construct(\AcceptanceTester $I) { $this->tester = $I; } /** * F...
Fix restore_database function not found
<?php include_once('bootstrap.php'); include_once('commonfunction.php'); include_once(GLPI_ROOT . "/config/based_config.php"); include_once(GLPI_ROOT . "/inc/dbmysql.class.php"); include_once(GLPI_CONFIG_DIR . "/config_db.php"); /* * Helper class to restore database from some SQL restore point file */ abstract cl...
<?php include_once('bootstrap.php'); include_once('commonfunction.php'); include_once(GLPI_ROOT . "/config/based_config.php"); include_once(GLPI_ROOT . "/inc/dbmysql.class.php"); include_once(GLPI_CONFIG_DIR . "/config_db.php"); /* * Helper class to restore database from some SQL restore point file */ abstract cl...
Add logout feature for acceptance testing
<?php /** * Inherited Methods * @method void wantToTest($text) * @method void wantTo($text) * @method void execute($callable) * @method void expectTo($prediction) * @method void expect($prediction) * @method void amGoingTo($argumentation) * @method void am($role) * @method void lookForwardTo($achieveValue) ...
<?php /** * Inherited Methods * @method void wantToTest($text) * @method void wantTo($text) * @method void execute($callable) * @method void expectTo($prediction) * @method void expect($prediction) * @method void amGoingTo($argumentation) * @method void am($role) * @method void lookForwardTo($achieveValue) ...
Allow custom date formatting in list table date
<?php list($entity, $name) = Chalk\traverse_name($entity, $name); ?> <?php if (isset($entity->{"{$name}Date"})) { ?> <?= $entity->{"{$name}Date"}->diffForHumans() ?> <?php } else { ?> — <?php } ?>
<?php list($entity, $name) = Chalk\traverse_name($entity, $name); ?> <?php if (isset($entity->{"{$name}Date"})) { ?> <? if (isset($format)) { ?> <?= $entity->{"{$name}Date"}->format($format) ?> <? } else { ?> <?= $entity->{"{$name}Date"}->diffForHumans() ?> <? } ?> <?php } else { ?> — <?...
Fix missing new dependency in event tagger test
<?php namespace CultuurNet\UDB3\Event; use Broadway\CommandHandling\Testing\CommandHandlerScenarioTestCase; use Broadway\EventStore\EventStoreInterface; use Broadway\EventHandling\EventBusInterface; class EventTaggerTest extends CommandHandlerScenarioTestCase { protected function createCommandHandler( Ev...
<?php namespace CultuurNet\UDB3\Event; use Broadway\CommandHandling\Testing\CommandHandlerScenarioTestCase; use Broadway\EventStore\EventStoreInterface; use Broadway\EventHandling\EventBusInterface; class EventTaggerTest extends CommandHandlerScenarioTestCase { protected function createCommandHandler( Ev...
Implement two new bundle interface methods
<?php namespace Bundle\GravatarBundle; use Symfony\Component\HttpKernel\Bundle\Bundle as BaseBundle; class GravatarBundle extends BaseBundle { }
<?php namespace Bundle\GravatarBundle; use Symfony\Component\HttpKernel\Bundle\Bundle as BaseBundle; class GravatarBundle extends BaseBundle { public function getNamespace() { return __NAMESPACE__; } public function getPath() { return __DIR__; } }
Add more details to the directory
<?php $path = 'sample-dir'; function getPathType($path) { if ( is_file($path)) { return 'file'; } else if (is_link($path)) { return 'link'; } else if (is_dir($path)) { return 'dir'; } return "Unknown"; } function directoryToArray( $path, $fullPath, &$parentArray ) { ...
<?php $path = 'sample-dir'; function getPathType($path) { if ( is_file($path)) { return 'file'; } else if (is_link($path)) { return 'link'; } else if (is_dir($path)) { return 'dir'; } return "Unknown"; } function directoryToArray( $path, $fullPath, &$parentArray ) { ...
Change the case to match the actual ID value
{{-- $breadcrumbs => array // ['display_name', 'relative_url'] --}} <nav class="mt-6 mb-2" aria-label="Breadcrumbs"> <ul class="text-sm"> @foreach($breadcrumbs as $key=>$crumb) @if($key == 0) <li class="inline"> <a href="/" aria-labelledby="Home"><span cla...
{{-- $breadcrumbs => array // ['display_name', 'relative_url'] --}} <nav class="mt-6 mb-2" aria-label="Breadcrumbs"> <ul class="text-sm"> @foreach($breadcrumbs as $key=>$crumb) @if($key == 0) <li class="inline"> <a href="/" aria-labelledby="home"><span cla...
Install npm packages with unsafe permissions
<?php namespace Opifer\CmsBundle\Composer; use Composer\Script\Event; class ScriptHandler { public static function installAssets(Event $event) { $event->getIO()->write('<info>Installing CmsBundle assets</info>'); $currentDirectory = getcwd(); $cmdDirectory = __DIR__.'/..'; ...
<?php namespace Opifer\CmsBundle\Composer; use Composer\Script\Event; class ScriptHandler { public static function installAssets(Event $event) { $event->getIO()->write('<info>Installing CmsBundle assets</info>'); $currentDirectory = getcwd(); $cmdDirectory = __DIR__.'/..'; ...
Add user profile url generator test.
<?php use App\User; class UserTest extends TestCase { /** * Test that the getAvatarUrl function returns the correct Gravatar URL for a specific email. */ public function testGeneratedGravatarUrlIsCorrect() { $user = new User(); $user->email = 'me@mitchfizz05.net'; $this-...
<?php use App\User; class UserTest extends TestCase { /** * Test that the getAvatarUrl function returns the correct Gravatar URL for a specific email. */ public function testGeneratedGravatarUrlIsCorrect() { $user = new User(); $user->email = 'me@mitchfizz05.net'; $this-...
Fix Upgrade Error with no Administrators Group
<? defined('C5_EXECUTE') or die("Access Denied."); class ConcreteUpgradeVersion5622Helper { public function run() { // add user export users task permission $pk = PermissionKey::getByHandle('access_user_search_export'); if (!$pk instanceof PermissionKey) { $adminGroupEntity = GroupPermissionAccessEntity...
<? defined('C5_EXECUTE') or die("Access Denied."); class ConcreteUpgradeVersion5622Helper { public function run() { // add user export users task permission $pk = PermissionKey::getByHandle('access_user_search_export'); if (!$pk instanceof PermissionKey) { $pk = PermissionKey::add('user', 'access_user_s...
Include header and footer on testrun view
<?php $form = new Form( 'testrun', 'create' ); $form->output( function( $self ) { $self->createLabel( 'name', 'Which test do you want to run?' ); $self->createInput( 'text', 'name', 'name' ); $self->createInput( 'submit', '', '', 'Test' ); } ); ?>
<?php include 'views/header.php'; $form = new Form( 'testrun', 'create' ); $form->output( function( $self ) { $self->createLabel( 'name', 'Which test do you want to run?' ); $self->createInput( 'text', 'name', 'name' ); $self->createInput( 'submit', '', '', 'Test' ); } ); i...
Add translation context to PASS/FAIL
<?php defined('C5_EXECUTE') or die("Access Denied."); /** * @var $grade \Concrete\Core\Health\Grade\PassFailGrade */ if ($grade->hasPassed()) { $textClass = 'text-success'; $title = t('PASS'); $icon = 'fa fa-thumbs-up'; } else { $textClass = 'text-danger'; $title = t('FAIL'); $icon = 'fa fa...
<?php defined('C5_EXECUTE') or die("Access Denied."); /** * @var $grade \Concrete\Core\Health\Grade\PassFailGrade */ if ($grade->hasPassed()) { $textClass = 'text-success'; $title = tc('CheckResult', 'PASS'); $icon = 'fa fa-thumbs-up'; } else { $textClass = 'text-danger'; $title = tc('CheckResu...
Revise return hint of method signature
<?php /** * @author Guidance Magento Team <magento@guidance.com> * @category Guidance * @package Simplepage * @copyright Copyright (c) 2015 Guidance Solutions (http://www.guidance.com) */ /** * Class Guidance_Simplepage_Block_ContentType * * @method float getContentType() * @method Guidance_Simp...
<?php /** * @author Guidance Magento Team <magento@guidance.com> * @category Guidance * @package Simplepage * @copyright Copyright (c) 2015 Guidance Solutions (http://www.guidance.com) */ /** * Class Guidance_Simplepage_Block_ContentType * * @method string getContentType() * @method Guidance_Sim...
Fix typo in number collection
<?php namespace SimplePHPEasyPlus\Number; use SimplePHPEasyPlus\Collection\CollectionInterface; /** * Represents a number collection */ class NumberCollection implements CollectionInterface { /** * @var ArrayObject An array of NumberValue items */ protected $numbers; /** * Constructor ...
<?php namespace SimplePHPEasyPlus\Number; use SimplePHPEasyPlus\Collection\CollectionInterface; use SimplePHPEasyPlus\Collection\CollectionItemInterface; /** * Represents a number collection */ class NumberCollection implements CollectionInterface { /** * @var ArrayObject An array of NumberValue items ...
Fix copyRows() and sqlite connection
<?php class OC_Migrate_Provider_Bookmarks extends OC_Migrate_Provider{ // Create the xml for the user supplied function export( $uid ){ $options = array( 'table'=>'bookmarks', 'matchcol'=>'user_id', 'matchval'=>$uid, 'idcol'=>'id' ); $ids = OC_Migrate::copyRows( $options ); $ids = array('1');...
<?php class OC_Migrate_Provider_Bookmarks extends OC_Migrate_Provider{ // Create the xml for the user supplied function export( $uid ){ OC_Log::write('migration','starting export for bookmarks',OC_Log::INFO); $options = array( 'table'=>'bookmarks', 'matchcol'=>'user_id', 'matchval'=>$uid, 'idcol'=>'...
Make DataUpdateRequest in ActivityLog clickable
<?php return [ /* * 各 model 對應的顯示路由 */ 'route' => [ \App\User::class => 'user.show', \App\Club::class => 'clubs.show', \App\TeaParty::class => 'tea-party.show', ], ];
<?php return [ /* * 各 model 對應的顯示路由 */ 'route' => [ \App\User::class => 'user.show', \App\Club::class => 'clubs.show', \App\TeaParty::class => 'tea-party.show', \App\DataUpdateRequest::class => 'data-update-request.show', ], ];
Simplify and inline the identity loss function.
<?php declare(strict_types=1); namespace mcordingley\Regression\Linkings; use mcordingley\Regression\Helpers; final class Identity extends Linking { public function delinearize(float $value): float { return $value; } public function linearize(float $value): float { return $value...
<?php declare(strict_types=1); namespace mcordingley\Regression\Linkings; use mcordingley\Regression\Helpers; final class Identity extends Linking { public function delinearize(float $value): float { return $value; } public function linearize(float $value): float { return $value...
Fix controller that doesn't have a `name` param in path
<?php namespace Djebbz\TicketBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { public function indexAction($name) { return $this->render('DjebbzTicketBundle:Default:index.html.twig', array('name' => $name)); } }
<?php namespace Djebbz\TicketBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { public function indexAction() { return $this->render('DjebbzTicketBundle:Default:index.html.twig', array('content' => 'Test content')); } }
Add basic tests for the formatting
<?php namespace Nwidart\MoneyFormatter\Tests; class MoneyFormatterTest extends \PHPUnit_Framework_TestCase { /** * Test that true does in fact equal true */ public function testTrueIsTrue() { $this->assertTrue(true); } }
<?php namespace Nwidart\MoneyFormatter\Tests; use Money\Currency; use Money\Money; use Nwidart\MoneyFormatter\MoneyFormatter; class MoneyFormatterTest extends \PHPUnit_Framework_TestCase { /** @test */ public function should_format_as_english_pounds() { $formatter = new MoneyFormatter('en_GB'); ...
Put payment logic here instead of in the user model; Allow for multiple payments instead of a single payment
<?php namespace App\Http\Controllers; use App\DuesTransaction; use Illuminate\Http\Request; class DashboardController extends Controller { /** * Returns view with data for the user dashboard * * @param Request $request * @return mixed */ public function index(Request $request) { ...
<?php namespace App\Http\Controllers; use App\DuesTransaction; use Illuminate\Http\Request; class DashboardController extends Controller { /** * Returns view with data for the user dashboard * * @param Request $request * @return mixed */ public function index(Request $request) { ...
Support added for the HTML box
<?php /** * A special form element which allows the user to enter arbitrary HTML code * in a form. * @author ekow * @ingroup Forms */ class HTMLBox extends Container { public $content; /** * Creates a new HTML box * @code * $box = new HTMLBox("<h1>Hello World!</h1>"); * @endcode ...
<?php /** * A special form element which allows the user to enter arbitrary HTML code * in a form. * @author ekow * @ingroup Forms */ class HTMLBox extends Container { public $content; /** * Creates a new HTML box * @code * $box = new HTMLBox("<h1>Hello World!</h1>"); * @endcode ...
Use trashed() to check if deleted
{{-- Copyright 2016 ppy Pty. Ltd. This file is part of osu!web. osu!web is distributed with the hope of attracting more community contributions to the core ecosystem of osu!. osu!web is free software: you can redistribute it and/or modify it under the terms of the Affero GNU General Public License...
{{-- Copyright 2016 ppy Pty. Ltd. This file is part of osu!web. osu!web is distributed with the hope of attracting more community contributions to the core ecosystem of osu!. osu!web is free software: you can redistribute it and/or modify it under the terms of the Affero GNU General Public License...
Update the property extractor wrapper
<?php /* * This file is part of Bens Penhorados, an undergraduate capstone project. * * (c) Fábio Santos <ffsantos92@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace App\Extractors\Wrappers; /** * This is th...
<?php /* * This file is part of Bens Penhorados, an undergraduate capstone project. * * (c) Fábio Santos <ffsantos92@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace App\Extractors\Wrappers; /** * This is th...
Fix bug where empty mapping was processed
<?php declare(strict_types=1); namespace Mihaeu\PhpDependencies\Formatters; use Mihaeu\PhpDependencies\Dependencies\Dependency; use Mihaeu\PhpDependencies\Dependencies\DependencySet; use Mihaeu\PhpDependencies\Dependencies\DependencyMap; class DependencyStructureMatrixBuilder { public function buildMatrix(Depen...
<?php declare(strict_types=1); namespace Mihaeu\PhpDependencies\Formatters; use Mihaeu\PhpDependencies\Dependencies\Dependency; use Mihaeu\PhpDependencies\Dependencies\DependencySet; use Mihaeu\PhpDependencies\Dependencies\DependencyMap; class DependencyStructureMatrixBuilder { public function buildMatrix(Depen...
Fix PHPDocs for proper IDE completion
<?php namespace Behat\Symfony2Extension\Context; use Symfony\Component\HttpKernel\KernelInterface; /* * This file is part of the Behat\Symfony2Extension. * (c) Konstantin Kudryashov <ever.zet@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with ...
<?php namespace Behat\Symfony2Extension\Context; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /* * This file is part of the Behat\Symfony2Extension. * (c) Konstantin Kudryashov <ever.zet@gmail.com> * * For the full copyright and license informati...
Update display name for commentaries
<?php namespace ATPComic\Model; require_once("Arc.php"); class Commentary extends \ATP\ActiveRecord { public function displayName() { return $this->page->title . ' by ' . $this->user->username; } } Commentary::init();
<?php namespace ATPComic\Model; require_once("Arc.php"); class Commentary extends \ATP\ActiveRecord { public function displayName() { return "'" . $this->title . "' for '" . $this->page->title . "' by " . $this->user->username; } } Commentary::init();
Remove the link since it was added to the description now
<?php namespace Styleguide\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class HeroContainedTextController extends Controller { /** * Display the full width hero view. * * @param Request $request * @return \Illuminate\View\View */ public function...
<?php namespace Styleguide\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class HeroContainedTextController extends Controller { /** * Display the full width hero view. * * @param Request $request * @return \Illuminate\View\View */ public function...
Fix test case, remove Facade use for travis
<?php use ThibaudDauce\EloquentInheritanceStorage\ParentTrait; use Illuminate\Database\Eloquent\Model as Eloquent; use Illuminate\Foundation\Testing\TestCase; use ThibaudDauce\EloquentInheritanceStorage\InheritanceStorage; use ThibaudDauce\EloquentInheritanceStorage\Facades\InheritanceStorage as FacadeInheritanceStorag...
<?php use ThibaudDauce\EloquentInheritanceStorage\InheritanceStorage; class InheritanceStorageTest extends PHPUnit_Framework_TestCase { public $character; public $inheritanceStorage; public function setUp() { parent::setUp(); // Build some objects for our tests $this->character = new Ch...
FIX wrong inclusion in test
<?php use PHPUnit\Framework\TestCase; require_once realpath(dirname(__FILE__).'/../Opbeat/client.php'); class ClientTest extends TestCase { public function testGetErrorLevel() { $this->assertEquals(Opbeat_Client::getErrorLevel(E_WARNING), 'warning'); $this->assertEquals(O...
<?php use PHPUnit\Framework\TestCase; require_once dirname(dirname(__FILE__)).'/Opbeat/client.php'; class ClientTest extends TestCase { public function testGetErrorLevel() { $this->assertEquals(Opbeat_Client::getErrorLevel(E_WARNING), 'warning'); $this->assertEquals(Opbea...
Add vat to the nl_BE provider
<?php namespace Faker\Provider\nl_BE; class Payment extends \Faker\Provider\Payment { /** * International Bank Account Number (IBAN) * @link http://en.wikipedia.org/wiki/International_Bank_Account_Number * @param string $prefix for generating bank account number of a specific bank * @pa...
<?php namespace Faker\Provider\nl_BE; class Payment extends \Faker\Provider\Payment { /** * International Bank Account Number (IBAN) * @link http://en.wikipedia.org/wiki/International_Bank_Account_Number * @param string $prefix for generating bank account number of a specific bank * @pa...
Change color Save button in Client form
<?php use hipanel\helpers\Url; use hipanel\modules\client\widgets\combo\SellerCombo; use hipanel\widgets\PasswordInput; use yii\bootstrap\ActiveForm; use yii\helpers\Html; $form = ActiveForm::begin([ 'id' => 'client-form', 'enableClientValidation' => true, 'validateOnBlur' => true, 'enableAjaxValidati...
<?php use hipanel\helpers\Url; use hipanel\modules\client\widgets\combo\SellerCombo; use hipanel\widgets\PasswordInput; use yii\bootstrap\ActiveForm; use yii\helpers\Html; $form = ActiveForm::begin([ 'id' => 'client-form', 'enableClientValidation' => true, 'validateOnBlur' => true, 'enableAjaxValidati...
Make -app parameter work again.
#!/usr/bin/php -q <?php /** * Command-line code generation utility to automate programmer chores. * * PHP 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2012, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the abov...
#!/usr/bin/php -q <?php /** * Command-line code generation utility to automate programmer chores. * * PHP 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2012, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the abov...
Move checking for tree inheritance inside count > 1 conditional to prevent issues when debugging with a single class
<?php namespace Sober\Controller; class Blade { protected $data; /** * Set Data * * Remove other array items should last item not include tree */ protected function setBladeData($data) { // Get __blade/__debugger key $this->data = $data['__data']['__blade']; ...
<?php namespace Sober\Controller; class Blade { protected $data; /** * Set Data * * Remove other array items should last item not include tree */ protected function setBladeData($data) { // Get __blade/__debugger key $this->data = $data['__data']['__blade']; ...
Fix migration that adds verification_token column to place it in correct position
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddVerificationTokenColumnToUsersTable extends Migration { public function up() { Schema::table('users', function (Blueprint $table) { $table->string('veri...
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddVerificationTokenColumnToUsersTable extends Migration { public function up() { Schema::table('users', function (Blueprint $table) { $table->string('veri...