Telegram Group & Telegram Channel
Пакет 👩‍💻 phplrt/phplrt несомненно хорош! Спасибо @SerafimArts за крутой инструмент!

Что бы вы сделали, будь у вас AST для proto message? Я бы, например, только в нем схемы и описывал 😁

final class MessageDefNodeTest extends TestCase
{
public function testParse(): void
{
$node = $this->parser->parse(
<<<'PROTO'
syntax = "proto3";

package example;

message Person {
string name = 1;
int32 id = 2;
string email = 3;
}
PROTO,
);

$this->assertSame('proto3', $node->syntax->syntax);
$this->assertSame('example', $node->package->name);

$message = $node->topLevelDefs[0];

$this->assertSame('Person', $message->name);
$this->assertCount(3, $message->fields);

$this->assertSame('name', $message->fields[0]->name);
$this->assertSame('string', $message->fields[0]->type);
$this->assertSame(1, $message->fields[0]->number);

$this->assertSame('id', $message->fields[1]->name);
$this->assertSame('int32', $message->fields[1]->type);
$this->assertSame(2, $message->fields[1]->number);

$this->assertSame('email', $message->fields[2]->name);
$this->assertSame('string', $message->fields[2]->type);
$this->assertSame(3, $message->fields[2]->number);
}
}
Please open Telegram to view this post
VIEW IN TELEGRAM
10🔥3🤔21



tg-me.com/php_fart/99
Create:
Last Update:

Пакет 👩‍💻 phplrt/phplrt несомненно хорош! Спасибо @SerafimArts за крутой инструмент!

Что бы вы сделали, будь у вас AST для proto message? Я бы, например, только в нем схемы и описывал 😁

final class MessageDefNodeTest extends TestCase
{
public function testParse(): void
{
$node = $this->parser->parse(
<<<'PROTO'
syntax = "proto3";

package example;

message Person {
string name = 1;
int32 id = 2;
string email = 3;
}
PROTO,
);

$this->assertSame('proto3', $node->syntax->syntax);
$this->assertSame('example', $node->package->name);

$message = $node->topLevelDefs[0];

$this->assertSame('Person', $message->name);
$this->assertCount(3, $message->fields);

$this->assertSame('name', $message->fields[0]->name);
$this->assertSame('string', $message->fields[0]->type);
$this->assertSame(1, $message->fields[0]->number);

$this->assertSame('id', $message->fields[1]->name);
$this->assertSame('int32', $message->fields[1]->type);
$this->assertSame(2, $message->fields[1]->number);

$this->assertSame('email', $message->fields[2]->name);
$this->assertSame('string', $message->fields[2]->type);
$this->assertSame(3, $message->fields[2]->number);
}
}

BY PHP Fart Time




Share with your friend now:
tg-me.com/php_fart/99

View MORE
Open in Telegram


PHP Fart Time Telegram | DID YOU KNOW?

Date: |

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

A project of our size needs at least a few hundred million dollars per year to keep going,” Mr. Durov wrote in his public channel on Telegram late last year. “While doing that, we will remain independent and stay true to our values, redefining how a tech company should operate.

PHP Fart Time from us


Telegram PHP Fart Time
FROM USA