ver.0.1
This commit is contained in:
@ -9,7 +9,6 @@
|
||||
* @property string $countryCode
|
||||
* @property string $phoneNumber
|
||||
* @property string $email
|
||||
* @property string $tempString
|
||||
*/
|
||||
class Information
|
||||
{
|
||||
@ -21,8 +20,6 @@ class Information
|
||||
public string $countryCode;
|
||||
public string $phoneNumber;
|
||||
public string $email;
|
||||
public string $tempString;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -66,26 +63,17 @@ class Information
|
||||
public function toString(): string
|
||||
{
|
||||
return $this->surname . ';' . $this->name . ';' . $this->patronymic . ';' . $this->dateOfBirth . ';' .
|
||||
$this->gender . ';' . $this->countryCode . ';' . $this->phoneNumber . ';' . $this->email . ";\n";
|
||||
$this->gender . ';' . $this->countryCode . ';' . $this->phoneNumber . ';' . $this->email . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $textArrayFromFile
|
||||
* @param string $search
|
||||
* @return string|null
|
||||
* @param string $str
|
||||
* @param $parsingArray
|
||||
* @return void
|
||||
*/
|
||||
public function search(array $textArrayFromFile, string $search): ?string
|
||||
public function stringToParsingArray(string $str, &$parsingArray): void
|
||||
{
|
||||
if($textArrayFromFile) {
|
||||
foreach ($textArrayFromFile as $str) {
|
||||
if (str_contains($str, $search)) {
|
||||
$this->tempString = strstr($str, $search);
|
||||
return substr($this->tempString, 0, strlen($search));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
$parsingArray[] = $str;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user