blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 116 | path stringlengths 2 241 | src_encoding stringclasses 31
values | length_bytes int64 14 3.6M | score float64 2.52 5.13 | int_score int64 3 5 | detected_licenses listlengths 0 41 | license_type stringclasses 2
values | text stringlengths 14 3.57M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
f0e82d42e9cd12fadc96f18364598bf89d12b496 | PHP | AmazeeLabs/cypress | /src/CypressRuntime.php | UTF-8 | 5,392 | 2.65625 | 3 | [] | no_license | <?php
namespace Drupal\cypress;
use Symfony\Component\Filesystem\Filesystem;
/**
* Manages the Cypress runtime directory.
*
* Responsible for directory creation, config file updates and collection of
* test requirements across different test suites.
*
* @package Drupal\cypress
*/
class CypressRuntime impleme... | true |
28863308473955ca397d46d426b3f5302d64bd28 | PHP | luoshengming/MyReadings | /books/html5-ia/src/main/resources/ch4/sse-chat/close-session.php | UTF-8 | 515 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
session_start();
include_once "credentials.php";
//remove it from the database
try {
$dbh = new PDO($db, $user, $pass);
$preparedStatement = $dbh->prepare('DELETE FROM `sessions`WHERE `session_id` =:sid');
$preparedStatement->execute(array(':sid' => session_id()));
$rows = $preparedStatement->fetc... | true |
ad71f68d1775f65bf5f8e8cb594ae2953e1022fa | PHP | medalidridi/trade-line | /trade_line/accueil/model/client.php | UTF-8 | 2,589 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
class client {
public $id;
public $nom;
public $prenom;
public $photo;
public $email;
public $confmail;
public $login;
public $pwd;
public $tel;
public $adresse;
public $civilite;
public $dnc;
public function Addclient(client $client)
{
include("config.php");
$q=$db->prepare('insert into cli... | true |
697ee38928da7eb320733909e5614032f53f7648 | PHP | hobocta/patterns | /src/Hobocta/Patterns/Behavioral/Observer/Observer.php | UTF-8 | 262 | 2.53125 | 3 | [] | no_license | <?php
namespace Hobocta\Patterns\Behavioral\Observer;
/**
* Interface Observer
* @package Hobocta\Patterns\Behavioral\Observer
*/
interface Observer
{
/**
* @param JobPost $jobPosting
*/
public function onJobPosted(JobPost $jobPosting);
}
| true |
1f888577bf716df241369a890f084632a29d39c8 | PHP | TallAndSassy/livewire-friends | /tests/Feature/Http/Controllers/LivewireFriendsControllerTest.php | UTF-8 | 2,400 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace TallAndSassy\LivewireFriends\Tests\Feature\Http\Controllers;
class LivewireFriendsControllerTest extends \TallAndSassy\LivewireFriends\Tests\TestCase
{
/** @test */
public function global_urls_returns_ok()
{
// Test hard-coded routes...
$this
->get('/grok/TallA... | true |
8debfef5d2a088d37c271290105bb9aa8a8611d6 | PHP | Erryk20/mini-framework | /migrations/20200506102923_create_category_table.php | UTF-8 | 635 | 2.609375 | 3 | [] | no_license | <?php
use Phinx\Migration\AbstractMigration;
class CreateCategoryTable extends AbstractMigration
{
public function up()
{
$table = $this->table('category');
$table->addColumn('parent_id', 'integer', ['null' => true])
->addIndex('parent_id')
->addColumn('name', 'string', ['limit' => 100])
->sa... | true |
6cf3dcb1f77102f6f5c294696ae29637635cfa73 | PHP | rutgerkirkels/DomoticzPHP | /src/Hardware/AbstractHardware.php | UTF-8 | 1,771 | 3.21875 | 3 | [
"MIT"
] | permissive | <?php
namespace rutgerkirkels\DomoticzPHP\Hardware;
abstract class AbstractHardware
{
/**
* @var int
*/
protected $id;
/**
* @var string
*/
protected $name;
/**
* @var string
*/
protected $type;
/**
* @var array
*/
protected $devices;
pub... | true |
84249afb2fa8ac208abf75ca25a5cf1a786f46c7 | PHP | DSim0111/ProjekatPSI_MTS | /faza6/app/Models/DeliveryRequestsModel.php | UTF-8 | 1,608 | 2.625 | 3 | [] | no_license | <?php
namespace App\Models;
use CodeIgniter\Model;
/**
* Description of CategoriesModel
*
* @author Simona
*/
class DeliveryRequestsModel extends Model {
//put your code here
protected $table = 'deliveryrequest';
protected $primaryKey = 'idDelReq';
protected $returnType = 'object';
protected... | true |
50398af44f10e285eb6069f9db847cc58b0f5e16 | PHP | decole/planka-php-sdk | /src/Actions/Card/CardCreateAction.php | UTF-8 | 1,011 | 2.671875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Planka\Bridge\Actions\Card;
use Planka\Bridge\Contracts\Actions\ResponseResultInterface;
use Planka\Bridge\Contracts\Actions\AuthenticateInterface;
use Planka\Bridge\Contracts\Actions\ActionInterface;
use Planka\Bridge\Traits\AuthenticateTrait;
use Planka\Bridge\Traits\CardHy... | true |
1d320bcb43dcff03310e7ae94bdf2b45ac77e283 | PHP | Sete7/3sturismo | /admin/View/Admin/AdminView.php | UTF-8 | 6,219 | 2.625 | 3 | [] | no_license | <?php
//require_once '../Controller/UsuarioController.php';
//require_once '../Model/Usuario.php';
$nome = "";
$resultado = "";
$usuarioController = new UsuarioController();
$btnCadastrar = filter_input(INPUT_POST, 'btnCadastrar', FILTER_SANITIZE_STRING);
if ($btnCadastrar) {
$usuario = new Usuario();
$usu... | true |
8e0ee83e7b426488c9d4d2ab587879d927d65b74 | PHP | ProklUng/framework-tools-bundle | /Services/Wordpress/Context.php | UTF-8 | 9,240 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace Prokl\FrameworkExtensionBundle\Services\Wordpress;
use JsonSerializable;
/**
* Class Context
* @package Prokl\FrameworkExtensionBundle\Services\Wordpress
*
* @since 10.06.2021
* @see https://github.com/inpsyde/wp-context
*/
class Context implements JsonSerializable
{
public const AJAX = 'aj... | true |
0fa97f9648c92964cd179813c10ba1f33f06297b | PHP | dindakhrsm/absenv2-1 | /app/Models/Room.php | UTF-8 | 725 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: eka
* Date: 22/01/16
* Time: 15:24
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Room extends Model
{
protected $table = 'rooms';
/**
* The database table primary key.
*
* @var string
... | true |
be53b8e7964c5569c0d5b88badae33fea5500ccb | PHP | jotamolas/att | /src/att/attBundle/Services/WorkFlowService.php | UTF-8 | 1,707 | 2.84375 | 3 | [] | no_license | <?php
namespace att\attBundle\Services;
use Doctrine\ORM\EntityManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use att\attBundle\Entity\Atworkflow;
use att\attBundle\Entity\Atworkflowmsg;
class WorkFlowService {
protected $em;
protected $container;
public function __construct(... | true |
8128bbd8eca54423a92f72d5658e681e6f8e4469 | PHP | jackieluper/csp_portal_style | /htm/controllers/products.db.php | UTF-8 | 2,402 | 2.65625 | 3 | [] | no_license | <?php
require 'config.php';
require 'email.php';
require '../classes/offers.class.php';
//setting initial variables/objects
$entity = $_SESSION['entity'];
$offers = new offers();
try {
//query to get offer details and to determine if it is a top offer or not
$getOfferDetails = "SELECT top_offer, offer.id, off... | true |
d78be80f5a2f481d0fa61acba7999b78717bfc73 | PHP | dominx99/poly-backend | /src/Map/Application/Handlers/RemoveCurrentMapObjectHandler.php | UTF-8 | 1,009 | 2.546875 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace App\Map\Application\Handlers;
use App\Map\Application\Commands\RemoveCurrentMapObject;
use Doctrine\ORM\EntityManagerInterface;
use App\Map\Domain\Map\MapObject;
final class RemoveCurrentMapObjectHandler
{
/** @var \Doctrine\ORM\EntityManagerInterface */
private $enti... | true |
5a36e134afe4b51e36562521ff35636dade78b26 | PHP | paoim/PHPDemo | /stringdemo/app/StringDemo.php | UTF-8 | 1,800 | 3.046875 | 3 | [] | no_license | <?php
class StringDemo
{
public function __construct() {
$this->display();
}
private function display() {
echo "<pre>"; print_r(substr('Welcome', 0, 1)); echo "</pre>";
echo "<pre>"; print_r($this->_getXXXSSN('0487')); echo "</pre>";
echo "<pre>"; print_r($this->_getXXXSSN('72-0487')); echo "</pre>";
ec... | true |
5749c7d70de1ef146c2f1a3ade1dc4d83405445b | PHP | DrexelSeniorDesign2016Team8/Middleware | /getUser.php | UTF-8 | 376 | 2.53125 | 3 | [] | no_license | <?php
require_once 'setup.php';
require_once 'session.class.php';
$json = array();
$sid = $_GET['sid'];
$user_name = Session::fetchName($sid);
if($user_name == false) {
$json['status'] = 'error';
$json['error'] = 'No user found for this session';
} else {
$json['status'] = 'success';
$json['response'] = array('u... | true |
a6bdb9ccca14de3b0de7caeb95a0945388654a75 | PHP | gregoriohc/argentum-common | /src/Common/Document/Invoice.php | UTF-8 | 2,126 | 3.28125 | 3 | [
"MIT"
] | permissive | <?php
namespace Argentum\Common\Document;
use Argentum\Common\Exception\InvalidDocumentException;
use Argentum\Common\Person;
/**
* Invoice class
*
* Invoice document type
*
* Example:
*
* <code>
* // Define document parameters, which should look like this
* $parameters = [
* 'id' => 'A-123',
... | true |
795de1e722b99ba2befba4aa31f76e3ba72b8f80 | PHP | lingpj/jiu | /application/command/Export.php | UTF-8 | 2,470 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\command;
use think\console\input\Argument;
use think\console\Input;
use think\console\Output;
use think\Db;
/**
* Created by PhpStorm.
* Author: zjh
* Date: 2017-7-4 004
* Time: 8:25
*/
class Export extends \think\console\Command
{
function configure()
{
$this->setName('export')->setDescr... | true |
1b96a2f72bfc66f0b55dfc4f6a6369ef50292b08 | PHP | human-programmer/portfolio-warehouse | /lib/services/services/accounts/AmocrmAccounts.php | UTF-8 | 1,598 | 2.828125 | 3 | [] | no_license | <?php
namespace Services;
use Services\General\iAccount;
trait AmocrmAccounts {
function findAmocrmById(int $amocrm_account_id): iAccount|null {
$query = self::createFindAmocrmByIdQuery($amocrm_account_id);
return $this->singleGetMethod($query);
}
private static function createFindAmocrmByIdQuery(int|arra... | true |
1211255424c37ae68146181c87999b2069841e2a | PHP | hackerlank/php-webserver | /cls/dao/lock.php | UTF-8 | 2,965 | 2.734375 | 3 | [] | no_license | <?php
/**
* @author guoyunfeng
*/
class cls_dao_lock extends sys_daoabs
{
private static $pid;
private static $lock_dir = 'tmp/';
private static $lock_array = array();
public function __construct()
{
parent::__construct();
self::$pid = getmypid();
self::$lo... | true |
bb19c7c25737e3eaf16212b26e112e3bb548b96f | PHP | alberto234/wurrd-client-interface-plugin | /Classes/ThreadProcessor.php | UTF-8 | 6,297 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | <?php
/*
* This file is a part of Wurrd ClientInterface Plugin.
*
* Copyright 2015 Eyong N <eyongn@scalior.com>.
*
* 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.ap... | true |
73e29d79bd2d811b90de05637f0d39dba77d05b6 | PHP | root-tongue/root-tongue | /vvv/www/root-tongue/content/mu-plugins/library/root-tongue/email-messages.php | UTF-8 | 2,272 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace Root_Tongue;
class Email_Messages extends Abstracts\Hooks {
protected function hook() {
add_filter( 'retrieve_password_title', array( $this, 'retrieve_password_title' ) );
add_filter( 'retrieve_password_message', array( $this, 'retrieve_password_message' ), 10, 3 );
add_filter( 'rt_new_user_ema... | true |
2b868c7c3aff4f8c262dd3676791adecf6c081f3 | PHP | AttafMohammed/briefphp | /Les tableaux/EX6.php | UTF-8 | 433 | 2.671875 | 3 | [] | no_license | <?php
/*
5 départements en Hauts-de-France
Aisne (02)
Nord (59)
Oise (60)
Pas-de-Calais (62)
Somme (80)
*/
$departement = array( "2"=>"Aisne", "59"=> "Nord", "60"=>"Oise","80"=>"pasDeCalais");
// echo '<pre>'; print_r($mois); echo '</pre>';
// $departement['41']='cc';
$departement['51']= 'Reims';
echo $departement... | true |
0a75c01ec5d00ba6da8354c48fbeb171b593b575 | PHP | newfulin/fu-cloud | /app/Modules/Finance/Repository/RedPacketRepository.php | UTF-8 | 1,877 | 2.59375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: wqb
* Date: 2018/3/9
* Time: 15:49
*/
namespace App\Modules\Finance\Repository;
use App\Common\Models\RedPacket;
use Illuminate\Support\Facades\DB;
use App\Common\Contracts\Repository;
class RedPacketRepository extends Repository
{
public function __construct(RedPac... | true |
0878d6d06f7a385a90cb45f0cc03914394763385 | PHP | jalfcolombia/nogal.se | /core/NQL.php | UTF-8 | 5,727 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the NogalSE package.
*
* (c) Julian Lasso <jalasso69@misena.edu.co>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NogalSE;
use NogalSE\Interfaces\IDriver;
/**
* Noga... | true |
9d862745e5c50b7b8fff33978b1f1e910b98eec2 | PHP | DavyJones8/eNubesPrueba | /application/helpers/fecha_helper.php | UTF-8 | 809 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
function fechaEspCorta( $fecha ){
$fecha = trim(substr($fecha, 0, 20));
$numeroDia = date('d', strtotime($fecha));
$mes = date('m', strtotime($fecha));
$anio = date('Y', strtotime($fecha));
$fecha_modificada = $numeroDia . '/' . $mes . '/' . $anio;
return $fecha_modificada;
}
... | true |
b864881a0afe57aa603d21c52a5de29b8cb48168 | PHP | olakunlevpn/Php-Contact-Form | /incl/config.php | UTF-8 | 1,684 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
// Maximum file size in MB.
$max_file_size = 1;
// Allowed file types. On the left side is user friendly file type presentation, on the right side is mime type presentation (you can found almost all mime types on this site: http://www.freeformatter.com/mime-types-list.html).
// You can add as many file types as... | true |
c7e99f6d6009913ccd9a6565c9e42161d20fca8f | PHP | ZgeZh/shishangqiyi | /src/php/base.php | UTF-8 | 1,256 | 2.984375 | 3 | [] | no_license | <?php
//初始化连接对象方法
function connect(){
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "shishangqiyi";
$con = mysqli_connect($servername,$username,$password,$dbname);
//获取连接对象的错误信息
if (mysqli_connect_error($con)) {
echo "连接 MySQL 失败:".mysqli_connect_error();
return nu... | true |
6d5318ee503ae5678c351fd200b4fe7d8479288e | PHP | luis-luciano/workBrigades | /app/helpers.php | UTF-8 | 2,767 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
use Carbon\Carbon;
function plural($name = null)
{
if (str_contains($name, '.')) {
return trans_choice($name, 2);
}
return trans_choice($name.'.'.str_singular($name), 2);
}
function singular($name = null)
{
if (str_contains($name, '.')) {
return trans_choice($name, 1);
}
... | true |
1b0df098ebea1e0b81bca609b74fd16a892f6045 | PHP | arman-arif/pbss_testimonial | /libraries/Controller.php | UTF-8 | 230 | 2.578125 | 3 | [] | no_license | <?php
namespace libraries;
interface Controller
{
public function __construct();
public function get_view();
public function get_title();
public function get_script();
public function get_style();
} | true |
eab13ac40af6e3d9c7bf4337551d3835d55f7985 | PHP | JoaoASousa/Hoaloha | /includes/session.php | UTF-8 | 241 | 2.609375 | 3 | [] | no_license | <?php
function generate_random_token(){
return bin2hex(openssl_random_pseudo_bytes(32));
}
if (session_status() == PHP_SESSION_NONE) session_start();
if (!isset($_SESSION['csrf'])) $_SESSION['csrf'] = generate_random_token();
?> | true |
89b1e323b0c174c7fa3fbc0c07d821a0da3e9d80 | PHP | jamilcse13/design-pattern-in-action | /Strategy Pattern/index.php | UTF-8 | 880 | 3.4375 | 3 | [] | no_license | <?php
/**
* Created by Anonymous
* Date: 2/5/20
* Time: 1:34 am
*/
interface PaymentGateway{
public function pay($amount);
}
class DCC implements PaymentGateway{
public function pay($amount)
{
echo "Paying $amount using Debit/Credit card\n";
}
}
class Stripe implements PaymentGateway {
... | true |
c3b229c00617e44d35a28fba13263f9dbf5b6667 | PHP | Lidemy/mentor-program-4th-YongChenSu | /homeworks/week11/hw1/admin.php | UTF-8 | 2,237 | 2.703125 | 3 | [] | no_license | <?php
session_start();
require_once('./conn.php');
require_once('./utils.php');
$username = NULL;
$user = NULL;
if (!empty($_SESSION['username'])) {
$username = $_SESSION['username'];
$user = getUserFromUsername($username);
}
if ($user === NULL || $user['role'] !== 'ADMIN') {
header('Lo... | true |
82eeb6153dbfca6a459301d7f2f2bb436bc2d6c8 | PHP | Malcolm-soubdhan/TP_mini_jeu | /class/Mage.php | UTF-8 | 228 | 2.625 | 3 | [] | no_license | <?php
class Mage extends Perso
{
public function __construct(){
$this->PV = 100;
$this->MP = 5;
$this->defense = 0;
$this->attack = rand(5, 10);
$this->image = "hat.png";
}
} | true |
c53becb9baced33448b5b265cdc7e762e2f0eedb | PHP | realchief/Symfony-wonderly | /src/AppBundle/DataFixtures/ORM/EventFixture.php | UTF-8 | 4,957 | 2.625 | 3 | [] | no_license | <?php
namespace AppBundle\DataFixtures\ORM;
use CrEOF\Spatial\PHP\Types\Geometry\Point;
use Doctrine\Common\Persistence\ObjectManager;
use FrontendBundle\Entity\Age;
use FrontendBundle\Entity\Category;
use FrontendBundle\Entity\Event;
use UserBundle\Entity\Organize;
/**
* Class EventFixture
* @package AppBundle\Da... | true |
7082cd1b8ffff722afe78e4b96f6cecb032e0840 | PHP | aizuyan/PHP-Migration | /src/Changes/v5dot4/IncompHashAlgo.php | UTF-8 | 1,446 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace PhpMigration\Changes\v5dot4;
use PhpMigration\Changes\AbstractChange;
use PhpMigration\SymbolTable;
use PhpParser\Node\Expr;
use PhpParser\Node\Scalar;
class IncompHashAlgo extends AbstractChange
{
protected static $version = '5.4.0';
protected $funcTable = [
'hash',
'hash_fi... | true |
32456f08621f3c17dd44283dfb250d5718610fbf | PHP | suzondas/quiz-app-vendor | /cmed-admin/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php | UTF-8 | 268 | 3.015625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace DeepCopy;
/**
* Deep copies the given value.
*
* @param mixed $value
* @param bool $useCloneMethod
*
* @return mixed
*/
function deep_copy( $value, $useCloneMethod = FALSE )
{
return ( new DeepCopy( $useCloneMethod ) )->copy( $value );
}
| true |
4c2fb9c27f925af4f317618383accd69b2336e42 | PHP | Thibok/tc-blog | /lib/Components/StringField.php | UTF-8 | 2,363 | 3.203125 | 3 | [] | no_license | <?php
/*
* This file is part of the Tc-blog project.
*
* (c) Thibault Cavailles <tcblog@tc-dev.ovh>
*
* First blog in PHP
*/
namespace Components;
class StringField extends Field
{
/**
*
* @var int
* @access private
*/
private $maxLength;
/**
*
* @var string
* @access private
*/
private... | true |
a022adcb05cb20591c3c5c2bdd2bcf7035811bba | PHP | Fizax/project-fifa-php | /admin.php | UTF-8 | 1,288 | 2.859375 | 3 | [] | no_license | <?php
require 'config.php';
$sql = "SELECT * FROM teams"; //string even opslaan die we later gaan gebruiken
$query = $db->query($sql); //qurey verzoek data base sla ik op in variablke
$teams = $query->fetchAll(PDO::FETCH_ASSOC); //multie demensionale array //alle colomen wil ik fet... | true |
2e79c40fce0856c935fc1fa413b3bd2954a0b0f8 | PHP | VrushaliBhosale/registration | /UserRegistration/update_user.php | UTF-8 | 1,384 | 3 | 3 | [] | no_license | <?php
require_once "vendor/autoload.php";
use UserRegistration\Activity\User;
$obj=new User();
$row=$obj->getRecord($_GET['u_id']);
echo $id;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compa... | true |
dbf38ff346ee8915ee465ba485c3a16996085850 | PHP | fidus/api | /Fidus/Api/RechargeCredit.php | UTF-8 | 882 | 3.03125 | 3 | [] | no_license | <?php
namespace Fidus\Api;
class RechargeCredit implements IRequest {
const TYPE = 'recharge-credit';
/**
* @var
*/
private $customerId;
/**
* @var
*/
private $rechargeCredit;
/**
* @var \DateTime
*/
private $date;
/**
* @param $customerId
* @param $rechargeCredit
* @param \DateTime $... | true |
ca0c50f971237acdb610811ca4d540c6fb075003 | PHP | SagarNaliyapara/order-product-test-demo | /tests/Feature/ProductsApiTest.php | UTF-8 | 2,257 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Tests\Feature;
use App\Product;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ProductsApiTest extends TestCase
{
use RefreshDatabase;
public function testProductList()
{
// create products with quantity greater than 1
factory(Product::class,... | true |
5bcc5148fa1ef2ef53a0055cb5fdaa58b6ca7dca | PHP | sharpless/ridcully | /src/CObject/CObject.php | UTF-8 | 1,867 | 2.96875 | 3 | [] | no_license | <?php
/**
* Base class for enabling access to Ridcully through $this
*
* @package RidcullyCore
* @author Fredrik Larsson <fredrik@sharpless.se>
*
*/
class CObject {
public $config;
public $data;
public $request;
public $database;
public $views;
public $session;
protected function __construct($... | true |
653453defb5021ef8954899cd698a204aedd7dc7 | PHP | T3hArco/skeyler-site | /index.php | UTF-8 | 1,428 | 2.71875 | 3 | [] | no_license | <?php
require '_.php';
$page = new Page();
$page->header('test');
function parseForums()
{
$out = "";
$resp = curlGet("showboards");
$boardArray = json_decode($resp, true);
for ($i = 0; $i < count($boardArray); $i++) {
for ($j = 0; $j < count($boardArray[$i]) / 2; $j++) {
if ($j == 0) {
$o... | true |
c787dd0f6252bc2b96150ef38f8dbfefb98beb6d | PHP | joaovmorais00/TP---CLP | /tp_CLP_PHP/Produto.php | UTF-8 | 611 | 3.25 | 3 | [] | no_license | <?php
class Produto{
private $nome;
private $codigo;
private $valor;
public function __construct($nome, $codigo, $valor){
$this->nome = $nome;
$this->codigo = $codigo;
$this->valor = $valor;
}
public function get_nome(){
return $this->nome;
}
public function get_codigo(){
return... | true |
22c0b4c40909296cbf48ffe0b567f2ee2a33b129 | PHP | tflori/dependency-injector | /tests/Examples/AdvancedSingleton.php | UTF-8 | 525 | 2.90625 | 3 | [] | no_license | <?php
namespace DependencyInjector\Test\Examples;
class AdvancedSingleton
{
/** @var AdvancedSingleton[] */
protected static $instances = [];
public $name;
private function __construct(string $name)
{
$this->name = $name;
}
private function __clone()
{
}
public stat... | true |
e926568bdd7224325a8dc426faee884b4472e879 | PHP | ip2location/ip2proxy-php | /examples/example.php | UTF-8 | 758 | 2.609375 | 3 | [
"MIT",
"LicenseRef-scancode-other-permissive"
] | permissive | <?php
error_reporting(\E_ALL);
ini_set('display_errors', 1);
require 'vendor/autoload.php';
// Lookup by local BIN database
$db = new \IP2Proxy\Database('./data/PX11.SAMPLE.BIN', \IP2PROXY\Database::FILE_IO);
echo 'Module Version: ' . $db->getModuleVersion() . \PHP_EOL . \PHP_EOL;
echo 'Package: PX' . $db->getPacka... | true |
4a0585d53e424d138431d9ec8076946aff03659b | PHP | moelj/sqli-eztoolbox | /Entity/Doctrine/Parameter.php | UTF-8 | 2,648 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace SQLI\EzToolboxBundle\Entity\Doctrine;
use Doctrine\ORM\Mapping as ORM;
use SQLI\EzToolboxBundle\Annotations\Annotation as SQLIAdmin;
use stdClass;
/**
* @ORM\Table(name="eboutique_parameter")
* @ORM\Entity(repositoryClass="SQLI\EzToolboxBundle\Repository\Doctrine\ParameterRepository")
* @SQLIAdmin... | true |
30e0d3e33bdd03949de4c256201d3641ac438a78 | PHP | vera-yxu/Website | /myfav.php | UTF-8 | 1,855 | 2.515625 | 3 | [] | no_license | <html>
<head>
<link rel="stylesheet" href="main_style.css" type="text/css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.del_btn').click(function(){
var homeid ... | true |
11292224aad814a5db654620909449c8b9f87cd9 | PHP | anandsm08/phpmysqlworkshopiitb | /DAY1/Q1_evenodd.php | UTF-8 | 147 | 3.953125 | 4 | [] | no_license | //Even or Odd numbers
<?php
$input = readline('Enter a Number');
if ($input%2)
{
echo $input.('is odd');
}
else {
echo $input.('is even');
}
?>
| true |
569de74c7d761cc87b2dcd8a788804fb5a9d6be2 | PHP | Malek23923/fakoli | /cms/components/svg_charts/pages/test_morphing_histogram.inc | UTF-8 | 850 | 2.53125 | 3 | [] | no_license | <?php
Fakoli::using("svg_charts");
$chart = new Histogram("histogram", 600, 400, 50, 50, 400, 300, "standard");
$chart->setLabels(array("First", "Second", "Third", "Fourth"));
$chart->ticks = 5;
$chart->max = 100;
$chart->morphing = true;
$series = new HistogramSeries("block", "Series 1", array(10, 40, 20, 8... | true |
57b9055cb20519d61a4c7ec0bfe8031d05f7c0ee | PHP | Calinou/godot-asset-library-laravel | /app/AssetPreview.php | UTF-8 | 2,548 | 2.921875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace App;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* An externally-hosted asset preview (can be an image or a video).
* It can optionally have a caption defined.
*
* @property int $preview_id The preview's unique ID.
... | true |
fdaca23b7585db2d5b411d9b293ad40f8d96da55 | PHP | SviatoslavSheludchenko/bintime | /models/User.php | UTF-8 | 3,044 | 2.71875 | 3 | [] | permissive | <?php
namespace app\models;
use DateTime;
use Yii;
use yii\db\ActiveRecord;
/**
* @property int $id
* @property string $login
* @property string $password
* @property string $first_name
* @property string $last_name
* @property int $gender
* @property string $date
* @property string $email
*/
class User ext... | true |
71064344a029040603eea1476795efb8a567fc46 | PHP | edb-gjengen/inside | /includes/payex2/payex_pxpartner.php | UTF-8 | 2,629 | 2.65625 | 3 | [] | no_license | <?php
require_once('payex.php');
/**
* Class for using the PxPartner Payex webservice.
* Please report bugs to support.solutions@payex.no
*
* @author Jon Helge Stensrud, Keyteq AS
* @version 5.3
*
*/
class PayexPxPartner extends Payex
{
var $ivrCode;
var $transactionStatus;
var $transactionRef;
var $trans... | true |
584b2159b21e47a07fdee774539c89ce263f38c2 | PHP | inetstudio/dummy_package | /src/Mail/NewDummyMail.php | UTF-8 | 1,465 | 2.671875 | 3 | [] | no_license | <?php
namespace InetStudio\Dummies\Mail;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use InetStudio\Dummies\Contracts\Mail\NewDummyMailContract;
use InetStudio\Dummies\Contracts\Models\DummyModelContract;
/**
* Class NewDummyMail.
*/
class NewDummyMail extends Mailable implements NewDummyM... | true |
1d2f28895581b5801ab9ef6660ea73a573d64730 | PHP | zupaazhai/simpler | /app/Enum/MediaEnum.php | UTF-8 | 1,121 | 2.875 | 3 | [] | no_license | <?php
namespace App\Enum;
class MediaEnum
{
const DIR = 'dir';
const FILE = 'file';
const ROOT = 'root';
/**
* Allowed mimes
*
* @return array
*/
public static function allowedMimes()
{
return array(
'image/jpeg' => 'jpg',
'image/pjpeg... | true |
de8b1b4b019c1bf2e6a092a8c61fc0348b996596 | PHP | Shofiul-Alam/magento-app | /src/vendor/magento/framework/Setup/Declaration/Schema/Operations/CreateTable.php | UTF-8 | 5,285 | 2.59375 | 3 | [
"OSL-3.0",
"LicenseRef-scancode-unknown-license-reference",
"AFL-2.1",
"AFL-3.0",
"MIT"
] | permissive | <?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Setup\Declaration\Schema\Operations;
use Magento\Framework\Setup\Declaration\Schema\Db\DbSchemaWriterInterface;
use Magento\Framework\Setup\Declaration\Schema\Db\DDLTriggerInterface;
use... | true |
4fe68feaddaed19e6d3c0a4b2120b54b50b43124 | PHP | Enas1998/Web_Page_Robot_Arm_control | /update.php | UTF-8 | 920 | 2.59375 | 3 | [] | no_license | <?php
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
$dbc=mysqli_connect('localhost', 'root', '');
@mysqli_select_db($dbc, 'new_data');
$query = "SELECT * FROM handles_values ORDER BY ID DESC LIMIT 1;";
$result = mysqli_query($dbc, $query);
echo "<br>";
echo "<table border='1'>";
while($row = ... | true |
0e17ede181e0e08bc806bf0546da35198af9867f | PHP | sundaravadivel1980/fleetsu-service | /src/DBO/ServiceDBO.php | UTF-8 | 537 | 2.671875 | 3 | [] | no_license | <?php
namespace src\DBO {
use \PDO, \PDOException, src\Logger\Logger, src\endpoints;
class ServiceDBO {
const QUERY_LOADALL_DEVICELIST = 'SELECT device_id, device_label, device_reported_datetime, device_status FROM devices';
private $_dbh;
public function __construct($dbh) {
$this->_dbh = $dbh;
}
... | true |
08d3ff550a57a2fd2b989e741baf42034678be95 | PHP | gizmore/gdo6 | /GDO/Javascript/Method/DetectNode.php | UTF-8 | 2,865 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace GDO\Javascript\Method;
use GDO\Core\GDT_Response;
use GDO\Core\Website;
use GDO\Core\MethodAdmin;
use GDO\Util\Process;
use GDO\Javascript\Module_Javascript;
use GDO\Form\GDT_Form;
use GDO\Form\MethodForm;
use GDO\Form\GDT_Submit;
/**
* Auto-detect nodejs_path, uglifyjs_path and ng_annotate_path.
* ... | true |
f6d6d93b53c7e000ad5b56c61a1c90325397806a | PHP | felipe-gerula/Ejercicios-Laboratorio-IV | /tp N°5/Models/BattleShip.php | UTF-8 | 452 | 3.15625 | 3 | [] | no_license | <?php
namespace Models;
use Models\Ship as Ship;
class BattleShip extends Ship{
//Attributes
private $armament;
//Constructors
function __construct(){
}
//Get
public function getArmament(){
return $this->armament;
}
... | true |
1a652fdf761918676bf42d845bb0c3927aa78c06 | PHP | BryanLizana/project_one_senati-school_stark | /views/root/del-user.php | UTF-8 | 736 | 2.53125 | 3 | [] | no_license | <?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ( is_numeric($_POST['id_user']) && $_POST['id_user'] !== '0') {
$user = new Users();
$user->id_user = $_POST['id_user'];
$user->delete_user();
header('location:/root/detail/');//redireccionar a la lista de usuarios una vez elimin... | true |
3fdac3ad31c6cda27a8f7e02b6d35b3f3084393a | PHP | SEOService2020/phpmorphy | /src/phpMorphy/Dict/Source/Mrd.php | UTF-8 | 2,303 | 2.515625 | 3 | [
"LGPL-2.1-only"
] | permissive | <?php
/*
* This file is part of phpMorphy project
*
* Copyright (c) 2007-2012 Kamaev Vladimir <heromantor@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; eith... | true |
0e4867e2f59162156c2577bb1af4ba66543ce0ee | PHP | Lalama1982/PHPStuff | /PHP_Practise/displayValuesSent.php | UTF-8 | 544 | 2.8125 | 3 | [] | no_license | <?php
// Retrieve data from POST String
$name = $_GET['name'];
$email = $_GET['email'];
$gender = $_GET['gender'];
$course = $_GET['course'];
$class = $_GET['class'];
$subject = $_GET['subject'];
$display_string = "<p>Your name is $name</p>";
$display_string .= "<p> your email address is $email</p>";
$display_string ... | true |
07aef2a6d95137df77967e232b807978c26ec056 | PHP | queicherius/stockphoto-crawler | /application/Console/Progressbar.php | UTF-8 | 1,329 | 3.390625 | 3 | [
"MIT"
] | permissive | <?php namespace Console;
class Progressbar
{
private $color = '32';
private $blocks = 20;
private $current_element = 0;
private $max_elements;
public function __construct($max_elements)
{
$this->max_elements = $max_elements;
$this->setProgress(0);
}
public function in... | true |
a2ad567d64d454f4f7bb96cff198e8e3511e11a7 | PHP | ogorzalka/Commentatic | /pi.commentatic.php | UTF-8 | 13,009 | 2.640625 | 3 | [] | no_license | <?php
class Plugin_commentatic extends Plugin {
public $meta = array(
'name' => 'Commentatic',
'version' => '1.0',
'author' => 'Olivier Gorzalka', // form part inspired by Eric Barnes (https://github.com/ericbarnes/Statamic-email-form)
'author_url' => 'http://clearideaz.com'
);
pu... | true |
2699fa408acc0d179e97d4c06c0b66ce88ea5292 | PHP | fossabot/flight-routing | /src/Middlewares/ResponseMiddleware.php | UTF-8 | 4,177 | 2.671875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | <?php
declare(strict_types=1);
/*
* This code is under BSD 3-Clause "New" or "Revised" License.
*
* PHP version 7 and above required
*
* @category RoutingManager
*
* @author Divine Niiquaye Ibok <divineibok@gmail.com>
* @copyright 2019 Biurad Group (https://biurad.com/)
* @license https://opensource.or... | true |
2902ba1813175c68f6c4a262b934a1a9ffc8c847 | PHP | Sherif-nasser/larvel-insightCRM | /app/Http/Controllers/Admin/CRUDController.php | UTF-8 | 2,134 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class CRUDController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**... | true |
a2ac3e3d72f1d0b06607267ae0336a1ded59cba2 | PHP | julianamayercardoso/public_html | /index.php | UTF-8 | 1,641 | 2.609375 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>Testes de html 5, ecmascript 6, css 3 e php 5</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#CCEEFF">
<ul>
<li> <h2>Programacao para internet</h2></li>
<li><h3>Engenharia de software</h3></li>
</ul>
<form>
... | true |
ecbaa8a5b32c43468a668a4c9fc81afb5c62a784 | PHP | healars/testNew | /uploader.php | UTF-8 | 1,794 | 2.703125 | 3 | [] | no_license | <?php
// get the q parameter from URL
$q = $_REQUEST ["q"];
if(empty($q)){
$q="client1";
}
$target_dir= "/home/maxprodisplays/public_html/client/clientImages/" . $q ."/";
//$target_dir="D:/xampp/htdocs/client/clientImages/" . $q ."/";
if (!is_dir ( $target_dir)) {
mkdir( $target_dir);
echo "dir... | true |
3e3f9fe7dd5184a5a22bf36c9e1f3a4bccae3331 | PHP | Vitvik/TestSoftGroup | /decision6.php | UTF-8 | 461 | 2.890625 | 3 | [] | no_license | <?php
ini_set('display_errors',1);
error_reporting(E_ALL ^E_NOTICE);
//Передаємо дані в масив
$arr = file('upload/protokol.txt');
unset($arr[0]);
$arr_as = array();
foreach ($arr as &$val) {
$data = explode(" ", $val);
foreach ($arr_as as $key_as => $val_as){
$key_as = $data[0];
$val_as = $da... | true |
0546784183f710903487c69064f5bf98866cf86b | PHP | Meuons/REST | /config/database.php | UTF-8 | 629 | 3.3125 | 3 | [] | no_license | <?php
class database{
//Store the database connection as properties
private $host = //host address goes here;
private $db_name = //database name goes here;
private $username = //username goes here;
private $password = //password goes here;
private $conn;
public function connect(){
//Create a database conn... | true |
1dfbcc86b96fe4e7ac4a9ee323ee589fb6104304 | PHP | zk45145/Collectionist | /api/app/Models/Collection.php | UTF-8 | 570 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Collection extends Model
{
use HasFactory;
const CREATED_AT = 'createdAt';
const UPDATED_AT = 'updatedAt';
protected $fillable = ['name', 'description', 'collection_type_i... | true |
319d9ff7761517f68e649024989cbe1cb3e8a4c7 | PHP | rickywrwn/titipankuAPI | /GetAllRequest.php | UTF-8 | 5,165 | 2.546875 | 3 | [] | no_license | <?php
include("DbConnect.php");
$email = $_GET["email"];
$sql = "SELECT * FROM user WHERE email = '$email'";
$result = mysqli_query($conn,$sql);
$user=array();
if(mysqli_num_rows($result) > 0)
{
while($row = $result->fetch_assoc()) {
$berat = $row["berat"];
$ukuran = $row["ukuran"];
}
}
if ($berat == '1... | true |
8f7b1abb9f94243ed17050e5404504d6cb46c90d | PHP | bcremer/LineReader | /src/LineReader.php | UTF-8 | 3,157 | 3.3125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Bcremer\LineReader;
final class LineReader
{
/**
* Prevent instantiation
*/
private function __construct()
{
}
/**
* @return \Generator<int, string, void, void>
*
* @throws \InvalidArgumentException if $filePath is not readable
... | true |
891b12b19c893f0b7e8c2dbb8aefc069d543d6f4 | PHP | cparello/CMS | /admin/billing/pastDueMonthly.php | UTF-8 | 9,900 | 2.515625 | 3 | [] | no_license | <?php
class pastDueMonthly {
private $contractKey = null;
private $prePayCount = null;
private $monthlyCount = null;
private $currentMonthDueDate = null;
private $nextMonthDueDate = null;
private $lateFee = null;
private $monthlyPayment = null;
private $nextPaymentDueDate = null;
private $todaysDate = null;
private ... | true |
232612f778887d7d7d0fc7cea0e12f27cce74003 | PHP | shinjia/201807_HCU_WebApp | /db_install/install_table.php | UTF-8 | 1,035 | 2.84375 | 3 | [] | no_license | <?php
include 'config.php';
// 連接資料庫
$link = db_open();
// 新增資料表之SQL語法 (採用陣列方式,可以設定多個)
$a_table['person'] = '
CREATE TABLE person (
uid int(11) NOT NULL auto_increment,
usercode varchar(255) NULL,
username varchar(255) NULL,
address varchar(255) NULL,
birthday date default NULL,
height int(11) default NU... | true |
42bba43e7265673d22ec7e47b6a38d2fb6749144 | PHP | gautamv16/verify_labs | /app/Http/Controllers/Admin/UsersController.php | UTF-8 | 4,908 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Admin;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class UsersController extends Controller
{
/**
* Display a listing of the resource.
*
* @return... | true |
b742c778dd1aba14206d4e568a97c64c150b8cf5 | PHP | Harut61/emt_inspect | /app/Console/Commands/FillFlatVulnerabilityByDate.php | UTF-8 | 1,415 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Console\Commands;
use App\FlatVulnerabilityByDate;
use App\Http\Controllers\VulnerabilityListController;
use App\Traits\Vulnerabilities;
use Illuminate\Console\Command;
class FillFlatVulnerabilityByDate extends Command
{
/**
* The name and signature of the console command.
*
* ... | true |
08e300558ebb710e5530f4dc0c3dcec8ef11e437 | PHP | rafaelbogaveev/vktest | /src/service/cacheService.php | UTF-8 | 3,836 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: root
* Date: 10/14/17
* Time: 5:49 AM
*/
require_once (__DIR__ . '/../data/memcached.php');
/**
* Returns data stored by key formed by parameters
*
* @param $key
* @return mixed
*/
function getValueByKey($key){
require (__DIR__.'/../data/memcached.php');
glob... | true |
bc21c42ba2502638a03c702f8764cb7d6be26e0f | PHP | SheriefBadran/PHP_PhotoGallery | /data/db/DatabaseAccessModel.php | UTF-8 | 4,594 | 3.078125 | 3 | [] | no_license | <?php
require_once(HelperPath.DS.'db/DB_Factory.php');
class DatabaseAccessModel {
// private static $dbUsername = "129463_ew31819";
// private static $dbPassword = "Qy.q55fc";
// private static $connectionString = 'mysql:host=photogallery-129463.mysql.binero.se;dbname=129463-photogallery';
private static $... | true |
1d6817ef1a70ab6e524d85d3e8a0b76a85815eb0 | PHP | PierreLefeuvre/news | /rest/app/News.php | UTF-8 | 308 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class News extends Model
{
public function getTitleAttribute($value)
{
return ucfirst(mb_strtolower($value));
}
public function getContentAttribute($value)
{
return str_replace('<br>',"\n", $value);
}
}
| true |
583d751deef014f25936805dc9425d62a5c7c708 | PHP | OpencachingTeam/opencaching | /code/htdocs/lib2/translate_filescan.class.php | UTF-8 | 2,837 | 2.921875 | 3 | [] | no_license | <?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
class translate_filescan
{
private $msFilename;
private $msContent;
... | true |
1d5ecfc347d3ef3ff044d0200180c9ef7787a4be | PHP | JML32/twitter-like | /php/functions/user.fn.php | UTF-8 | 848 | 3.015625 | 3 | [] | no_license | <?php
function register($db, $username, $password){
$check = $db->prepare("SELECT * FROM users WHERE username = :username");
$check->execute(array(
':username' => $username
));
if ($userExist = $check->fetch()){
// si la function renvoie true c'est que l'utilisateur existe
header('Location : i... | true |
81220b3389959ef3127cc11f34816676a1923f1f | PHP | thursdaybw/salsa-demo | /web/modules/salsa_api/src/ApiClient.php | UTF-8 | 4,218 | 2.609375 | 3 | [] | no_license | <?php
namespace Drupal\salsa_api;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Site\Settings;
use Drupal\Core\Url;
use GuzzleHttp\ClientInterface;
/**
* Dummy client. Can use this to simulate calling an API.
*
* This is a super dummy for this purpose, it does very little except
* return OK.
*/... | true |
e365efe1a49c9c68ca9e46c9e92bdc9659cf9d73 | PHP | pferre/dojos | /src/TicTacToe/Board.php | UTF-8 | 1,502 | 3.265625 | 3 | [] | no_license | <?php
namespace App\TicTacToe;
use App\TicTacToe\Exception\IllegalPlayerMoveException;
class Board
{
/** @var PlayerMove[] */
private $state;
/**
* @param PlayerMove $move
* @throws IllegalPlayerMoveException
*/
public function add(PlayerMove $move): void
{
if (!$this->pos... | true |
5f562f2c68a1ba4c4c80c0f2a3330690b9ce6144 | PHP | AdelekeIO/PAS | /form_functions.php | UTF-8 | 886 | 2.90625 | 3 | [] | no_license | <?php
function check_required_fields($required_array)
{
$field_errors=array();
foreach ($required_array as $fieldname) {
if (!isset($_POST[$fieldname]) || (empty($_POST[$fieldname]) && (!is_int($_POST[$fieldname])))){
if (empty($_POST[$fieldname]) && ($_POST[$fieldname]=='0')){
}else{$field_errors[]=$... | true |
b264056e2347e479d9f4bf72fc7549c93cf0b540 | PHP | yongho0720-nsmg/fanta_travel | /app/Console/Commands/CrawlerCheck.php | UTF-8 | 2,832 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\CrawlerLog;
use App\Push;
use App\Board;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
class CrawlerCheck extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protect... | true |
6a39f719e6d9d2b0211e348d48e854eb42e60d85 | PHP | hyyan/gwp | /helpers/Gwp/Composer/Create.php | UTF-8 | 2,213 | 2.703125 | 3 | [] | no_license | <?php
/*
* This file is part of the hyyan/gwp package.
* (c) Hyyan Abo Fakher <tiribthea4hyyan@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Gwp\Composer;
use Composer\Script\Event;
use Gwp\Util;
/**
* C... | true |
7674b29ba76fc250ff697a858a5ef4283aeae621 | PHP | nsttam/phpObjet | /index.php | UTF-8 | 756 | 2.859375 | 3 | [] | no_license | <?php
include 'include.php';
$audiRS1 = new Audi('Audi', 'RS1', 100000, 5, 1, 1, 0);
$z900 = new Kawasaki('Z900', 9200, true);
var_dump($audiRS1);
$audiRS1->isQuatro = 10; //pour __set //j'essaie de donner valuer 10 a attribut isQuatro mais lui il est privée, donc j'ai message
//"l'attribute... | true |
2572bfddc7997a15d7d5962f7db007657a0d518f | PHP | burgerballer44/tailgate | /app/Http/Requests/UpdateSeasonRequest.php | UTF-8 | 1,265 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use App\Models\Common\DateOrString;
use App\Models\SeasonType;
use App\Models\Sport;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Enum;
class UpdateSeasonRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this req... | true |
1d2740d9842c19e52d2718f6b7861d3fb975ef3b | PHP | adrianacerdeira-zz/RecursosPHP | /Aula_47_Classes_e_Objetos_Heranca/metodos_magicos.php | UTF-8 | 3,479 | 4.15625 | 4 | [] | no_license | <?php
class Pessoa
{
private $idade;
private $nome;
public $profissao;
private $attrNaoDeclarados = [];
/**
* Método invocado quando o objeto é instanciado
* Pessoa constructor.
* @param $nome
* @param $idade
* @param $profissao
*/
public function __construct($no... | true |
73744846c7c4edfd3f2b53c9838ea500f2de4dcf | PHP | yhprogram/study | /samaple01.php | UTF-8 | 234 | 2.640625 | 3 | [] | no_license | <?php
$price = 12300;
$total = $price * 1.05;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>sample page</title>
</head>
<body>
<?php echo "PHPによるテキストです。"; ?>
</body>
</html> | true |
aad697937f4feb1064bdd94d6db17c127f811964 | PHP | luongyen123/vitc | /HOANGDUCKIEN/demo.php | UTF-8 | 2,720 | 3.15625 | 3 | [] | no_license | <?php
// $mang_so_nguyen = [60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 81, 76, 73,
// 68, 72, 73, 75, 65, 74, 63, 67, 65, 64, 68, 73, 75, 79, 73];
// foreach ($mang_so_nguyen as $value) {
// $tong_gia_tri=0;
// $tong_gia_tri+=$value;
// $do_dai=count($mang_so_nguyen);
// }
// $tb= $tong_gia_tri/... | true |
413d7d8b335125877cf257927f5201a874e5ce98 | PHP | czim/laravel-cms-models | /src/Support/Strategies/Traits/HasMorphRelationStrategyOptions.php | UTF-8 | 1,331 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Czim\CmsModels\Support\Strategies\Traits;
use Czim\CmsModels\Contracts\ModelInformation\Data\Form\ModelFormFieldDataInterface;
use Czim\CmsModels\ModelInformation\Data\Form\ModelFormFieldData;
/**
* Class HasMorphRelationStrategyOptions
*
* For form field strategy data that will have options accordi... | true |
fa68c1fa9937c950ea560038fee3abc5ab5f33cb | PHP | PrashishPandey/Project1 | /laravel_8_api_crud/app/Http/Controllers/user_groups.php | UTF-8 | 3,653 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\model\user_group;
use App\model\user;
class user_groups extends Controller
{
//$ug=new user_group();
//$u=new user();
//-----insert function----
public function insert_group(Request $request){
//object create for user_gro... | true |
2b4dc325e090972fad8fba1f91f37b43dc5eee20 | PHP | janainafortunato/Estudos_php | /classes/Composicao.php | UTF-8 | 415 | 2.515625 | 3 | [] | no_license | <?php
include_once '../Fornecedor.php';
include_once '../Contato.php';
//instancia novo fornecedor
$fornecedor = new Fornecedor;
$fornecedor->razaoSocial ='Produto Bom Gosto S.A.';
//atribuir informações de contato
$fornecedor->setContato('Mauro', '51 1234-5678', 'mauro@bomgosto.com.br');
//inprime informações
echo... | true |
22a25e98b5720f38a89135102013e2a30cedec4e | PHP | Asera/TimeCounter | /timecount.php | UTF-8 | 358 | 3.046875 | 3 | [] | no_license | #! /usr/bin/php
<?php
require_once "TimeCounter.php";
$stdin = fopen('php://stdin', 'r');
$stdout = fopen('php://stdout', 'w');
$text = '';
while (!feof($stdin)) {
$text = $text.fgetc($stdin);
}
fputs($stdout, str_pad('', 20, '-').PHP_EOL);
$timeCounter = new TimeCounter($text);
$totalTime = $timeCounter->getTo... | true |
f4504c2fc0b6370ddf67e53754884ac2514dc2ef | PHP | st-universe/core | /src/Module/Colony/Lib/ColonyMenu.php | UTF-8 | 819 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Stu\Module\Colony\Lib;
use request;
use Stu\Component\Colony\ColonyEnum;
class ColonyMenu
{
private ?int $selectedColonyMenu;
public function __construct(?int $selectedColonyMenu)
{
$this->selectedColonyMenu = $selectedColonyMenu;
}
/**
* @... | true |