public static function extractFieldDefault($fieldString, $field) { $stringUtils = new String(stripslashes($fieldString)); $field->Default = String::getFirstChunk($stringUtils->substr('/DEFAULT\\s/')); if ($field->Type === 'INT') { $field->Default = (int) $field->Default; } }
/** * If pattern matched only inside single quotes and flag is set as true then return remaining. * @dataProvider dataProviderStringWithQuotes */ public function testIfPatternMatchedOnlyInsideSingleQuotesAndFlagIsSetAsTrueThenReturnRemaining($input, $expected) { $worker = new String($input); static::assertEquals($expected, $worker->substr('/DEFAULT\\s/', true)); }