This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: php:7.4-fpm | |
definitions: | |
steps: | |
- step: &composer-install | |
name: Build PHP | |
caches: | |
- composer | |
script: | |
- ls -al |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
vendor/bin/phpunit | |
(git push) || true | |
git checkout production | |
git merge master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset name="Laravel and similar phpmd ruleset" | |
xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description> | |
Inspired by https://github.com/phpmd/phpmd/issues/137 | |
using http://phpmd.org/documentation/creating-a-ruleset.html | |
</description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\support\lib; | |
class Rect | |
{ | |
protected $left; | |
protected $top; | |
protected $width; | |
protected $height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Manually create entries and send notifications with Gravity Forms | |
$form_id = 10; | |
// add entry | |
$entry = array( | |
"form_id" => $form_id, | |
"1" => "Entry for field ID 1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Base | |
def self.import!(record_list) | |
raise ArgumentError "record_list not an Array of Hashes" unless record_list.is_a?(Array) && record_list.all? {|rec| rec.is_a? Hash } | |
return record_list if record_list.empty? | |
(1..record_list.count).step(1000).each do |start| | |
key_list, value_list = convert_record_list(record_list[start-1..start+999]) | |
sql = "INSERT INTO #{self.table_name} (#{key_list.join(", ")}) VALUES #{value_list.map {|rec| "(#{rec.join(", ")})" }.join(" ,")}" | |
self.connection.insert_sql(sql) |