This file contains hidden or 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 | |
use Lithe\Testing\TestCase; | |
class UserManagerTest extends TestCase | |
{ | |
/** | |
* | |
* @var UserManager | |
*/ |
This file contains hidden or 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 | |
function most_letters_in_a_word($string) { | |
$string = preg_replace("/[^A-Za-z]/", ' ', $string); | |
foreach(array_filter(explode(' ', $string)) as $word) { | |
$words[max(count_chars($word, 1))] = $word; | |
} | |
return $words[max(array_keys($words))]; |
This file contains hidden or 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 | |
$errors = []; | |
if ($_SERVER['REQUEST_METHOD'] === 'POST') { | |
// Set required fields | |
$required = [ | |
'field_1', | |
'field_2' | |
]; |
This file contains hidden or 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 header('Content-Type: text/plain'); | |
for($i = 1; $i <= 100; $i++) { | |
$string = ''; | |
$string .= ($i % 3) == 0 ? "fizz" : ''; | |
$string .= ($i % 5) == 0 ? "buzz" : ''; | |
print (empty($string)) ? $i : $string; | |
print PHP_EOL; | |
} |
This file contains hidden or 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 Lithe\Database; | |
use Illuminate\Cache\CacheManager; | |
use Lithe\Contracts\Database\CacheInterface; | |
class Cache implements CacheInterface | |
{ | |
/** |
This file contains hidden or 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 Lithe\Routing; | |
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; | |
class RouteServiceProvider extends ServiceProvider | |
{ | |
/** | |
* |
This file contains hidden or 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 | |
if(!validate_request()) { | |
die('you requested data from a $_GET key that is not whitelisted.'); | |
} | |
echo 'Your request is valid'; | |
function validate_request($additional_keys = array()) { |
This file contains hidden or 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 | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class InstallProjectsModule extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* |
This file contains hidden or 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 Modules\System\Http\Controllers\Frontend; | |
use Modules\System\Http\Requests\Frontend\LoginRequest; | |
use Modules\System\Http\Requests\Frontend\RegisterRequest; | |
use Modules\System\Http\Requests\Frontend\ResetRequest; | |
use Modules\System\Domain\User\UserManager; | |
use Modules\System\Domain\User\UserRepositoryInterface; | |
use Modules\System\Domain\User\LoginManager; | |
use Modules\System\Domain\Validating\ValidatingManager; |
This file contains hidden or 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 | |
class Controller { | |
public function action() | |
{ | |
$model = MyModal::with('relationship')->first(); | |
return $model->relationshipPaginated(); | |
} |